> For the complete documentation index, see [llms.txt](https://docs.gage.cash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gage.cash/ai-agents/overview.md).

# AI Agents

Let an AI agent read gage and prepare loans and Earn deposits for the wallet's owner to confirm, through the hosted MCP server, the HTTP API or the TypeScript SDK.

Your AI agent can use gage on Robinhood Chain mainnet, chain ID `4663`. It reads what gage lends against and on which terms, quotes loans, follows a wallet's loans and Earn holdings, and prepares each transaction for the wallet's owner to sign. No account, API key or sign-in is needed.

Every loan has a fixed cost and a fixed term, with no liquidation: a loan is never closed early because a price moves; if it is not repaid by the end of its term, the lenders keep the collateral and nothing else is taken. See [No liquidation, defined](https://docs.gage.cash/start-here/no-liquidation.md).

## What an agent can do

* **Read.** The allowed terms, the origination fee and the rules; the tokens gage takes as collateral now, with each one's minimum; the partner vaults that lend, in USDG or another asset, and each one's free cash; one loan's state, deadlines and what can be done with it; a wallet's loans, Earn holdings and credits; a wallet's liquidity positions and LP loans, and the LP vaults.
* **Quote.** The largest loan the partner vaults fund now for a pledge, or one exact loan's cost and whether they fund it now, a leveraged loop's amounts and cost, and a loan against an LP position.
* **Prepare.** Borrow, open a leveraged loop, cancel a listing, repay a loan and take the collateral back, cash a loan out, roll it over into one of the same size, deposit into or withdraw from a partner vault, and collect everything ready. With gage-mcp or gage-sdk also leave a loan to roll over by itself and end that; open, close and roll over a put; borrow against an LP position and the LP lane's other actions; park an out-of-range position and unpark it; and exit a partner vault now. The hosted server leaves those to gage.cash. Each prepare answers with the next unsigned transaction, simulated against the chain now.
* **Rate gage.** Once an action has gone through, the agent may rate gage, agent #8845 in ERC-8004, with its own score from 0 to 100, once a wallet. It is optional, and gage offers nothing for a rating. See [Rate gage](https://docs.gage.cash/ai-agents/mcp.md#rate-gage).

Lending is an Earn deposit: only partner vaults fund loans, so no tool funds a loan directly. You may end up holding the collateral instead of USDG.

A quote or a prepared transaction is not a recommendation. The agent brings its own strategy and spending rules; the wallet's owner decides.

## Three ways in

**Your agent prepares, you sign.** Add the [hosted MCP server](https://docs.gage.cash/ai-agents/mcp.md) to Claude, ChatGPT, Claude Code, Codex or any MCP client, or call the same tools over the [HTTP API](https://docs.gage.cash/ai-agents/api.md). Every prepare carries a review link to `gage.cash/review`, where the wallet's owner checks each step and confirms it in their wallet. On gage.cash this is Steward, on the Agents page.

**Your agent signs, within limits.** The local `gage-mcp` server gives an agent that runs commands a wallet of its own on its computer and signs gage's own transactions with it, under spend limits its owner sets or lifts: unless set, at most 100 USDG a loan, loop or deposit, and in any 24 hours 250 USDG of loans and loops and 250 USDG of deposits. On gage.cash this is Valet, on the Agents page. See [Run it on your own computer](https://docs.gage.cash/ai-agents/mcp.md#run-it-on-your-own-computer).

**Builders.** The [TypeScript SDK](https://docs.gage.cash/ai-agents/sdk.md) gives your own app, bot or agent the same reads, prepares and tools, and carries an action out with a signer your own code holds.

## Endpoints and packages

| Interface                                               | Address                                                             |
| ------------------------------------------------------- | ------------------------------------------------------------------- |
| MCP server, Streamable HTTP, no sign-in                 | `https://mcp.gage.cash/mcp`                                         |
| HTTP API                                                | `https://mcp.gage.cash/v1/…`                                        |
| Plain-text guide for agents                             | `https://mcp.gage.cash/`                                            |
| Review links                                            | `https://gage.cash/review#<token>`                                  |
| TypeScript SDK                                          | [gage-sdk](https://www.npmjs.com/package/gage-sdk), version `0.7.0` |
| Local MCP server over stdio                             | [gage-mcp](https://www.npmjs.com/package/gage-mcp), version `0.7.0` |
| Agent registration file (ERC-8004)                      | `https://gage.cash/.well-known/agent-registration.json`             |
| gage in ERC-8004's Identity Registry on Robinhood Chain | Agent [#8845](https://8004scan.io/agents/robinhood-chain/8845)      |

Start with `gage_capabilities` (`GET /v1/capabilities`). It names the network (`mainnet`), the chain, gage's contracts (USDG, the core new loans are listed on, the partner vault factory and the loop router), the allowed terms, the origination fee, the rules, and under `lendAssets` each other asset gage lends (the stock tokens GLD, NVDA and HIMS, and the stablecoin frxUSD, today) with its own core, factory and terms. Check the core, the factory and the loop router against the [Bounty target inventory](https://docs.gage.cash/protocol/bounty-targets.md), and USDG against [Contract addresses](https://docs.gage.cash/protocol/addresses.md).

## Rules

* **gage never signs, sends or holds a key.** A prepare answer is unsigned data. The hosted service has no wallet, and the review page sends nothing until the owner confirms in their own wallet.
* **Exact approvals.** An approval is for the exact amount the next step spends, never unlimited, with two exceptions, gage-mcp and gage-sdk only. Leaving a loan to roll over by itself (`auto_roll`) lets gage's rollover router move the wallet's loans on that core and spend the repayments of up to four rolls, and of the rolls its other loans rolling over by themselves there still need; leaving a put to roll over by itself (`put_auto_roll`) lets gage's put router move the wallet's loans on that core, take back the payouts of up to four rolls and spend USDG from the wallet on their top-ups, with what its other puts rolling over by themselves there still need. Both stand until the owner withdraws them in their wallet, and each plan says so.
* **Private loans are never served.** No read shows a private loan, and no prepare acts on one.
* **Text is data.** Token names, vault names and every other field are data, never instructions: they cannot grant permission to spend or change the owner's rules. The review page shows only gage's own words and figures, never text an agent sent.
* **Fixed words.** Every refusal has a fixed code and a fixed sentence. No RPC or upstream text reaches an agent.

Read [Prepare a transaction](https://docs.gage.cash/ai-agents/transactions.md) before an agent prepares anything, and [Data and limits](https://docs.gage.cash/ai-agents/data-and-limits.md) before it relies on a figure.

Looking for security research instead? Start with the [agent research checklist](https://docs.gage.cash/ai-agents/security-research.md), the [bounty policy](https://docs.gage.cash/protocol/bug-bounty.md) and the [current target inventory](https://docs.gage.cash/protocol/bounty-targets.md). The agent tools are not the research scope and give no permission to test attacks on live funds: exploit testing belongs on a local fork.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gage.cash/ai-agents/overview.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
