# Call from code (https://sellersheetai.com/docs/mcp-api/code)

> Every tool your agent uses over MCP is also an HTTP operation — same name, same arguments, same result — for your own scripts, dashboards and approval pages.



<EarlyAccess />

What your agent calls in a conversation, your code calls by the same name with the same arguments. So your agent can build you your own tools on it — a live dashboard, a listing tool, an approval page — whose buttons act on Amazon exactly as the agent does in chat.

|             |                                                                                                            |
| ----------- | ---------------------------------------------------------------------------------------------------------- |
| Endpoint    | `POST https://api.sellersheetai.com/api/v1/tools/{tool}`                                                   |
| Auth        | `Authorization: Bearer <API key>` — an API key, not an MCP key ([Keys & store access](/docs/mcp-api/keys)) |
| Body        | the tool's arguments as a JSON object                                                                      |
| Result      | the same envelope the MCP tool returns ([Responses & errors](/docs/mcp-api/responses))                     |
| Catalog     | `GET https://api.sellersheetai.com/api/v1/tools`                                                           |
| OpenAPI 3.1 | `https://api.sellersheetai.com/api/v1/openapi.json`                                                        |

## One call [#one-call]

Start where an agent starts — `get_user_context` returns your store refs:

<ToolCall tool="get_user_context" />

Then pass one of its `store_refs` verbatim as the `store` of every store-scoped tool:

<ToolCall tool="fbaInventory_getInventorySummaries" args="{ seller_skus: [&#x22;SKU-A&#x22;, &#x22;SKU-B&#x22;] }" />

Every tool is a `POST`: a tool is an operation with arguments, not a resource. Whether it reads, writes or destroys is its access label in the catalog (see [Read, write & destructive](/docs/mcp-api/access)).

## Keep the key out of your code [#keep-the-key-out-of-your-code]

Save it once as `SELLERSHEET_API_KEY` — in your shell, or a `.env` file next to your script that is listed in `.gitignore` — and read it from there, as the snippets above do. A browser page has no `.env`: ask for the key when the page opens and keep it in `sessionStorage` under the same name — never in the HTML, never in a page you share.

## What to know before you build [#what-to-know-before-you-build]

* **The status code tells you whether it ran.** 200 means the call was carried out; a 4xx means it was not; 503 means Amazon, noon or the backend could not answer — retry after `Retry-After`. Details: [Responses & errors](/docs/mcp-api/responses).
* **Paging is your loop.** A list tool returns a token for the next page; call again with it. See [Paging](/docs/mcp-api/paging).
* **Show before you write.** A write should happen because a person pressed a button: show what will be sent first, and confirm explicitly before a destructive tool.
* **Long calls belong on MCP.** The public edge cuts an HTTP call still running after about 100 seconds. A long workflow — a whole FBA plan, a large A+ library — runs over MCP, whose streamed response is not cut.
* **Same limits as MCP.** API calls count under the same plan windows as your agent's calls; a 429 carries `Retry-After`. See [Credits & limits](/help/app/settings/billing).
* **Browser pages are allowed.** The API accepts calls from any origin with the `Authorization` and `Content-Type` headers and no cookies. A page hosted inside an AI client may be blocked from calling other hosts — run it as a local file, on localhost, or on your own host.

Every tool, with its arguments and a ready call: the [tool reference](/docs/mcp-api/tools).
