Perplexity Agent API MCP tool: connect Sume with allowed_tools

Perplexity's Agent API runs every MCP tool call with no approval step. Connect Sume's hosted MCP with an allowed_tools list so a model cannot reach paid tools.

5 min readSume
All posts

To use Sume from Perplexity's Agent API, add a tool of type: "mcp" with server_url set to https://mcp.sume.com/mcp, pass a Sume API key in a header, and set allowed_tools to the exact tools you want the model to see. The allowlist matters more than usual here: Perplexity's MCP tool page says the API does not support approvals yet, so "every MCP tool call auto-runs".

That sentence changes how you wire a paid server. With Claude Code or Cursor a person clicks approve on a paid generation. In an Agent API request nobody is watching, so the allowlist, the wallet and Sume's own gates are the only brakes. This post lays out which Sume tools to expose, what Sume enforces, and what it does not.

What does the Perplexity mcp tool accept?

Perplexity documents one request shape for a remote server. The fields below come from that page, read on 2026-10-02. The page also says only tools are supported (not MCP resources, prompts or sampling), the URL must be HTTPS with Streamable HTTP rather than legacy SSE, and approval features and connector OAuth flows are not supported.

Perplexity mcp tool fields that matter for Sume (read 2026-10-02)
FieldWhat Perplexity saysWhat to set for Sume
server_labelMust match ^[a-zA-Z0-9_-]{1,64}$sume
server_urlHTTPS, Streamable HTTPhttps://mcp.sume.com/mcp
authorizationOptional access token, never logged or echoedNot used here; Sume's documented key header is safer to send explicitly
headersOptional extra request headers (string values){"x-api-key": "<Sume API key>"}; Sume accepts x-api-key or Bearer
allowed_toolsAllowlist of tool names; omit to expose everything discoveredA short read-only list, plus the one paid tool you intend

Why an API key and not OAuth?

Sume's hosted MCP accepts OAuth access tokens or API keys, and they are not interchangeable (see OAuth and API keys). The OAuth path needs a person to sign in on https://mcp.sume.com/oauth/consent and choose whether to turn Write on. Perplexity's page says connector OAuth flows are not supported in the Agent API, so there is nowhere for that consent screen to happen. A backend call therefore uses an API key.

An API-key session sees the full hosted tool set, including mutating and paid tools, and the read-only default of OAuth mcp:read does not apply. If you want read-only behaviour you build it yourself with allowed_tools. Create the key in the API keys page and keep it in an environment variable, and keep it out of your own application logs.

Which Sume tools should allowed_tools list?

Start from tools_list, which returns every tool visible to the session with safety metadata, then copy names rather than guessing. Live ids use underscores. A sensible first allowlist for an agent that makes one image and reports back:

  • Read-only: balance_get, catalog_list, generation_admission_preview, jobs_status, jobs_wait, jobs_result.
  • One paid tool: generate_image. Paid and write tools require an idempotency_key; the model has to invent a stable one, so say so in the input.
  • Leave out jobs_cancel, assets_create and every other write tool unless the task needs them.

What does Sume enforce when nobody approves?

Three things, and one non-thing. idempotency_key is required on write and paid tools, but the docs call it transport and dedup, "not human approval". dry_run=true previews cost without submitting. max_spend_usd caps spend, but it is enforced only when provided, so a model that omits it has no per-call cap. Spend otherwise comes from your wallet and admission checks; there is no mcp:paid scope.

So put the cap in the instruction: tell the model to call generation_admission_preview or pass dry_run, to send max_spend_usd, and to use a fresh idempotency_key per intent. Models can ignore instructions. If a hard ceiling matters, keep paid tools off the allowlist and have your own code submit the paid call after reading the preview.

What does a working request look like?

This sketch uses the shape from Perplexity's page. The model id is the one in Perplexity's own example, so check the current list before shipping. A video or a slow image will not finish inside one request: Sume's jobs_wait holds for at most 55 seconds per call and answers wait_slice_expired when it runs out, and the right response is to call it again with the same ids, never to resubmit the create (Jobs and results).

import os
from perplexity import Perplexity

client = Perplexity()

response = client.responses.create(
    model="openai/gpt-5.6-sol",
    input=("Preview the cost of one product photo with generation_admission_preview. "
           "If it is under $1, call generate_image with a fresh idempotency_key "
           "and max_spend_usd 1, then jobs_wait and jobs_result."),
    tools=[{
        "type": "mcp",
        "server_label": "sume",
        "server_url": "https://mcp.sume.com/mcp",
        "headers": {"x-api-key": os.environ["SUME_API_KEY"]},
        "allowed_tools": ["balance_get", "generation_admission_preview",
                          "generate_image", "jobs_wait", "jobs_result"],
    }],
)
print(response)

Sources

Related posts

More in Integrations

All Integrations posts

Written by Sume