> ## Documentation Index
> Fetch the complete documentation index at: https://docs.raisegate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Building an agent

> How to build an MCP server or custom agent on this API.

RaiseGate already ships an MCP server over this API at `https://app.raisegate.com/api/mcp` (15 tools, same API keys, same scopes and rate limits). The guidance below applies to it and to any custom agent built directly on the REST API.

<AccordionGroup>
  <Accordion title="One tool per workflow step">
    `list_companies`, `get_company`, `add_company` (with an `Idempotency-Key` per call), `update_company`, `refresh_company`, `list_signals`, `list_alerts`, `list_leads`, `get_lead`, `track_lead`, `decide_lead`, `remove_company`.
  </Accordion>

  <Accordion title="Keep lists compact">
    Keep list tools on the compact view (the default) and fetch full detail only for the item the user is looking at. Compact `/tracker` is \~3k tokens per 25 items versus \~34k for full.
  </Accordion>

  <Accordion title="Prefer create-then-poll">
    Draft enrichment (`POST /tracker/enrich`) can exceed typical MCP tool timeouts. Create returns in seconds with a poll URL.
  </Accordion>

  <Accordion title="Mark destructive tools">
    Annotate removing a company (`DELETE`), pausing, and rejecting leads as destructive so MCP clients confirm with the user first.
  </Accordion>

  <Accordion title="Pass fuzzy names straight through">
    Let the user say "Anomaly Bio". Show `409 ambiguous_*` candidates to the user instead of choosing one.
  </Accordion>

  <Accordion title="Respect 429">
    Back off for `Retry-After` seconds. Never loop creates or refreshes.
  </Accordion>

  <Accordion title="Dedicated key per agent">
    Isolates usage, limits and revocation.
  </Accordion>
</AccordionGroup>

<Prompt description="Give an agent the Partner API" actions={["copy", "cursor"]}>
  You are helping a VC operate their RaiseGate tracker through the Partner API.

  Base URL: [https://app.raisegate.com](https://app.raisegate.com)
  Auth: Authorization: Bearer \$RAISEGATE\_API\_KEY
  MCP: [https://app.raisegate.com/api/mcp](https://app.raisegate.com/api/mcp) (same key)

  Rules:

  * Lists default to compact view. Only request view=full for the item the user is looking at.
  * Prefer company names (entityQuery / sourceQuery) over IDs. If the API returns 409 ambiguous\_\*, ask the user which candidate.
  * After add\_company or track\_lead, poll get\_company until enrichmentComplete is true, then until lastScrapedAt is set.
  * Confirm with the user before remove\_company, pausing, or rejecting a lead.
  * On 429, wait Retry-After seconds. Never loop creates or refreshes.
  * Do not call POST /api/v1/tracker/enrich from an agent. It can take up to four minutes.
</Prompt>
