Flux tools server reference

Exact schemas for every tool on the Flux tools server: arguments, return values, the API route behind each one, the tool error objects, and the routing server.

The Flux tools server gives an agent every Flux ability as an MCP tool. To add it to an agent, see Set up the Flux tools server. This page is the exact contract.

Transport and auth

URLhttps://api.fluxrouter.ai/mcp-tools/, with the trailing slash. Without it the server answers 307.
TransportStreamable HTTP, stateless. Each request stands alone: tools/list and tools/call need no initialize first and no session id.
AuthAuthorization: Bearer sk-flux... on every request. Flux keys only; no sign-in flow.
RepliesServer-sent events: read the JSON-RPC message from the data: line. Send Accept: application/json, text/event-stream.
Server nameflux-tools
StatusLive
bash
curl https://api.fluxrouter.ai/mcp-tools/ \
  -H "Authorization: Bearer sk-YOUR-FLUX-KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_capabilities","arguments":{}}}'

How tools bill

The tools server writes no charge of its own. Each tool calls the matching Flux API route over the server's own network, with your key, so the route authenticates, gates and bills the call exactly as if you had sent it yourself. The bill, the limits and the errors are the route's.

The tools

list_capabilities

Always listed, never billed. Live

  • Arguments: none.
  • Returns: tier (your plan), premium_unlocked (whether paid abilities work on this key) and enabled, an object keyed by ability. Each entry has premium (whether it needs a paid plan) and either est_microcents (an advisory cost per call, in millionths of a US dollar) or tools (each tool's billing rule, for abilities billed per unit). Entries may carry other fields; ignore any you do not use.

web_fetch

Live Calls POST /v1/fetch; see the fetch reference.

ArgumentTypeRequiredNotes
urlstringYesA public http or https URL.
  • Returns: markdown, format, url and cost_microcents. Always a plain read: render is API only.

web_search

Rolling out Calls POST /v1/search; see the search reference.

ArgumentTypeRequiredNotes
querystringYesUp to 2,000 characters.
  • Returns: answer, citations (URLs), searches, cost_microcents and cost_usd.

image_generate

Live Calls POST /v1/images/generations; see the images reference.

ArgumentTypeRequiredNotes
promptstringYesWhat to draw.
  • Returns: the generation response (created, data with the base64 image) plus cost_microcents. Your agent decodes b64_json and saves the file itself.
  • There is no edit tool. Edits are API only.

transcribe

Shipping Calls POST /v1/audio/transcriptions; see Speech to text.

ArgumentTypeRequiredNotes
audio_urlstringOne of the twoA public https URL. Private addresses are refused.
audio_base64stringOne of the twoThe file, base64-encoded. Send filename with it.
filenamestringWith audio_base64For example note.m4a.
languagestringNoA language hint, such as en.
promptstringNoContext or spellings to guide it.
  • Audio up to 8 MB.
  • Returns: text, billed_seconds and cost_usd.

speak

Shipping Calls POST /v1/audio/speech; see Text to speech.

ArgumentTypeRequiredNotes
textstringYesUp to 1,000 characters per call, fewer than the API.
voicestringNoA voice id. The tool's schema lists them.
formatstringNomp3 (default) or wav.
speednumberNo1.0 is normal.
  • Returns: an audio content block (base64) plus voice, format, mime_type, bytes, billed_chars and cost_usd. Your agent writes the audio to a file itself.

Apps tools

Shipping apps_list, apps_connect, apps_find_actions and apps_execute connect your Flux account to apps such as Gmail or Slack and run actions in them.

ToolArgumentsBilled
apps_listnoneNo
apps_connectapp; optional alias for a second account of the same appNo
apps_find_actionstask; optional appNo
apps_executeaction (from apps_find_actions), argumentsPer action

What they return, and how to chain them, is on the apps page.

Which tools you see

  • tools/list shows every tool your account can call, including paid tools on a Free plan.
  • A paid tool called on a Free plan answers premium_locked. After that refusal it appears once more in tools/list, then drops out of that account's list, so the agent stops trying it. It comes back once the plan is paid and cleared.
  • Each paid tool's description carries your plan and an advisory cost per call.

Tool error objects

A refusal is a normal tool result, never a protocol fault. Its structured content is:

json
{
  "error": "premium_locked",
  "capability": "web_search",
  "message": "Web search needs a paid, cleared Flux plan. Upgrade at https://fluxrouter.ai/home/billing.",
  "upgrade_url": "https://fluxrouter.ai/home/billing",
  "retryable": false
}
FieldWhenMeaning
erroralwaysThe code, from the table below.
capabilityalwaysThe ability that refused.
messagemost codesPlain English your agent can act on.
reasoncapability_unavailablePlain English, in place of message.
retryablealwaysWhether the same call can work later.
retry_after_secondssome rate_limitedHow long to wait.
upgrade_urlpremium_locked, payment_requiredWhere to upgrade or add credit.
price_microcentssome premium_lockedWhat the call would have cost.
errorRetryableCause
premium_lockedNoThe ability needs a paid, cleared plan.
payment_requiredNoThe route asked for payment: out of credit or allowance, or a paid plan is needed.
ability_disabledNoThe ability is not switched on for this account. Do not retry.
auth_failedNoThe key is missing, wrong, revoked or expired.
forbiddenNoThis key may not use the ability.
too_largeNoThe input is over a limit.
invalid_requestNoA bad argument, such as an unknown voice or a private URL.
rate_limitedYesToo many calls; wait and retry.
capability_unavailableUsuallyA temporary fault. Check retryable.

Fixes are on Tools server problems.

The routing server

A second MCP server at https://api.fluxrouter.ai/mcp exposes routing, not abilities. Status: Live

TransportPOST JSON-RPC 2.0. Protocol 2025-11-25; older versions are accepted.
SessionSend initialize first. Every later request must carry the MCP-Session-Id header it returns. DELETE ends the session; GET answers 405.
AuthAuthorization: Bearer sk-flux...
ToolArguments
flux_routeprompt or messages (one is required); optional tier (fast, standard, reasoning or auto, the default), model, max_tokens, temperature. Returns the answer and a decision_id.
flux_explaindecision_id from flux_route. Returns which model answered, the tier, the cost and the latency.
flux_modelsOptional tier (fast, standard, reasoning, pinned or all, the default).

Errors on this server are JSON-RPC errors: the standard codes -32700 to -32603, plus these Flux codes:

CodeMeaning
-32001A header does not match the request
-32002Unauthorised: the key is missing or not accepted
-32003Rate limited
-32004The MCP-Session-Id header is missing
-32005The session has expired; send initialize again