Provider REST API
AIConnect Claude to Google Gemini
Generate content with Gemini models, count tokens, and create embeddings. Toolspoke puts 9 of its actions behind one MCP endpoint that Claude, Cursor, and Codex all speak.
- Connection
- Provider REST API
- Authentication
- API key
- Actions exposed
- 9
- Cost per call (typical)
- 1 credit
- Adapter
- Maintained by Toolspoke
Connected in three steps
- 1
Install Google Gemini
Open the marketplace in your workspace, add Google Gemini to the project your agents work in, and it appears on the gateway immediately.
- 2
Connect the credential
Authenticate with api key. Where to get one, and what it has to be able to reach, is the next section.
- 3
Point your agent at the gateway
Give your client one address, https://toolspoke.com/mcp. Claude Code takes it as a command, Claude and Claude Desktop add it as a custom connector, and Cursor, Codex and VS Code each read it from a config file of their own.
.mcp.json{
"mcpServers": {
"toolspoke": {
"type": "http",
"url": "https://toolspoke.com/mcp"
}
}
}One block covers every tool you have installed. Google Gemini shows up in the client as soon as your policy allows it, and so does everything else you install later.
Where the address goes, per client
- Claude Code
Run it in your project, then /mcp to sign in
claude mcp add --transport http toolspoke https://toolspoke.com/mcp- Claude and Claude Desktop
Settings, then Connectors, then Add custom connector
https://toolspoke.com/mcp- Cursor
~/.cursor/mcp.json, or .cursor/mcp.json for one project
{ "mcpServers": { "toolspoke": { "url": "https://toolspoke.com/mcp" } } }- Codex
~/.codex/config.toml
[mcp_servers.toolspoke] url = "https://toolspoke.com/mcp"- VS Code
.vscode/mcp.json, or the MCP: Add Server command
{ "servers": { "toolspoke": { "type": "http", "url": "https://toolspoke.com/mcp" } } }
What Google Gemini asks for
API key. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.
- API keyRequired
- aistudio.google.com → Get API key
- AIza…
What Claude can do in Google Gemini
9 actions, each one declared and named by the connector rather than discovered at runtime. A workspace policy grants a person all of them, a hand-picked selection, everything on the read side, everything on the write side, or none.
- Reads
- 7Reads
- Writes
- 1Writes
- Destructive
- 1Destructive
Reads
7Fetches data and changes nothing.
list_modelsList the Gemini models this API key can call, each with its id, display name, description, input and output token limits, and the list of methods it supports - generateContent, countTokens, embedContent and so on. Call this before generate_content or embed_content whenever a model id is not certain: this connector deliberately hard-codes no model names, because Google's roster changes faster than a file in a repository can. Note that ids come back in "models/gemini-…" form, while every operation here takes the bare id without the "models/" prefix. Free, and the cheapest proof that the key works.
get_modelRead one model by id: display name, description, input and output token limits, default sampling settings, and which generation methods it supports. Use it to confirm a model can do what a request needs - that it lists embedContent before calling embed_content, or that its inputTokenLimit is large enough for a prompt count_tokens just measured. A 404 means this key cannot reach that id; call list_models to see what it can.
count_tokensCount how many input tokens a prompt would use against a given model, without generating anything and without being billed. A read, because nothing is created and nothing is charged. Use it before generate_content to check a prompt fits the model's inputTokenLimit, which get_model reports. Takes the same `contents` that generate_content takes, so count exactly what you intend to send. It measures input only; output tokens, usually the larger cost, are not predicted.
embed_contentTurn one piece of text into an embedding vector, for similarity search, clustering or retrieval. A read: it creates nothing and stores nothing, it only measures. Use an embedding model, not a generation model - "gemini-embedding-001" is the current one, and list_models shows which ids list embedContent among their supported methods. Set task_type to match what the vector is for; Gemini tunes the embedding to it, and using RETRIEVAL_QUERY for a search query against a corpus embedded with RETRIEVAL_DOCUMENT is what makes retrieval work. output_dimensionality shortens the vector when storage matters. For many strings at once, call batch_embed_contents instead.
batch_embed_contentsEmbed several strings in one request, returning one vector per string in the order given. Prefer this over calling embed_content repeatedly - Gemini counts each request against a per-minute rate limit, so one batch of fifty strings costs one request instead of fifty. Same model, task_type and dimensionality rules as embed_content, applied to every string in the batch. A read: nothing is created or stored.
list_filesList the files uploaded to this API key's Gemini File API storage: each one's name, display name, MIME type, size, state, expiry, and the `uri` that a generate_content part refers to as {"fileData":{"mimeType":…,"fileUri":…}}. That URI is the reason to call this. Gemini deletes uploaded files automatically after 48 hours, so a file listed yesterday may already be gone. Uploading is not offered here - it needs Google's resumable multipart upload, which this connector does not carry - so this lists what was put there by other means.
get_fileRead one uploaded file's record: display name, MIME type, size, expiry, and its `state`. State is what this is usually called for - a freshly uploaded video sits at PROCESSING and a generate_content call referring to it fails until it reaches ACTIVE. Returns metadata only; the bytes are not downloadable through this API. Get the id from list_files.
Writes
1Creates or updates something on the other side.
generate_contentGenerate a response from a Gemini model. This is the operation that costs money, which is why it is a write while count_tokens and list_models are reads, and why it is not the health check. Streaming is out of scope: the whole response comes back at once, with its candidates, finish reason, safety ratings and token counts. `contents` is Gemini's own conversation form - a list of turns, each with a role and a list of parts - so a single question is [{"role":"user","parts":[{"text":"…"}]}] and a multi-turn conversation alternates "user" and "model" roles. For a structured answer, set response_mime_type to "application/json" and give a response_schema. Call list_models first if the model id is not certain, and count_tokens first if the prompt might not fit. The prompt is prose and the response is a model's own output, so neither is written to the audit log.
Destructive
1Deletes or permanently alters something. Worth granting on purpose.
delete_fileDelete one uploaded file from the Gemini File API. There is no trash and no undo: the bytes go, and any generate_content call still referring to that fileUri fails from then on. Files expire by themselves after 48 hours, so deleting early is only worth doing when the content should not sit there that long. Get the id from list_files.
What it will not do
Enforced by the gateway rather than left to convention, which is why each of these can be stated flatly.
- It cannot call anything else
- The 9 actions above are the whole of it. A call to any other name is refused before it reaches Google Gemini rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time.
- It reaches no further than your credential
- Toolspoke holds no access to Google Gemini of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either.
- It never hears from Google Gemini
- Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in Google Gemini. An agent has to ask.
- It does not smooth over provider limits
- Toolspoke does not retry, queue or back off around Google Gemini's own rate limits. A call that Google Gemini refuses comes back to the agent as a failed call.
Before you connect it
What can Claude do in Google Gemini?
9 named actions: 7 that only read, 1 that write and 1 that delete or permanently alter something. They include list_models, get_model and count_tokens. Nothing outside that list is reachable: the connector declares each operation by name rather than proxying whatever an agent asks for.
What credentials does the Google Gemini connector need?
API key. The connector asks for api key. Values are encrypted at rest and attached to the outbound request by the gateway, so they are never part of the arguments an agent sends and never reach the audit log.
Does the Google Gemini connector work with Cursor and Codex, or only Claude?
Any client that speaks MCP, and every one of them gets the same 9 actions. There is a single address, https://toolspoke.com/mcp. Claude Code adds it with claude mcp add --transport http, Claude and Claude Desktop take it as a custom connector in settings, Cursor reads it from .cursor/mcp.json, Codex from ~/.codex/config.toml, and VS Code from .vscode/mcp.json. Each of them signs in to the gateway itself, so there is no key to paste.
What does the Google Gemini connector not do?
The 9 actions above are the whole of it. A call to any other name is refused before it reaches Google Gemini rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time. Toolspoke holds no access to Google Gemini of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either. Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in Google Gemini. An agent has to ask. Toolspoke does not retry, queue or back off around Google Gemini's own rate limits. A call that Google Gemini refuses comes back to the agent as a failed call.
Can I limit which actions an agent can call?
Yes, in two places. The project switches Google Gemini's actions on and off one at a time, for everyone in the project at once, and the screen groups them by read, write and destructive so turning off everything that deletes is one click. An individual agent key can then be narrowed further, to particular toolkits in a project and to particular actions in a toolkit. Whatever it was granted, a key never reaches a project its owner cannot.
What gets recorded when an agent calls Google Gemini?
Every attempt, with the agent that made it and the person that agent belongs to, the full request payload, the response payload, the status, the duration, and the credits spent. Values whose key names a secret are masked out before the record is shown to anyone. An operation the connector marks as not retained never has its response body written at all, so the gateway keeps no second copy of what was read.