Skip to main content
Glama

call_service

Invoke any registered API service through a pay-per-call proxy. Each call auto-charges USDC from your Pay Token and returns the upstream response with charge details.

Instructions

Invoke an upstream API service through LemonCake's pay-per-call proxy. Each successful call automatically charges USDC against your configured Pay Token.

PRECONDITIONS: • LEMON_CAKE_PAY_TOKEN env var must be set. If missing, the tool returns a structured CREDENTIAL_MISSING error (not a thrown exception) with how-to-fix steps. • serviceId must come from list_services.

BEHAVIOR: • Returns the upstream response body verbatim (JSON or text), plus the X-Charge-Id and X-Amount-Usdc headers reported by the proxy. • HTTP 402 Payment Required is returned as a normal result (NOT thrown) so the agent can autonomously stop spending when the Pay Token's limitUsdc is exhausted. • Pass the same idempotencyKey to retry safely without double-charging. • This tool spends real money and contacts an external service — it is non-idempotent by default and has external side effects.

Returns: { status, chargeId, amountUsdc, response }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceIdYesID of the service to call (obtain from list_services).
pathNoSub-path on the service (e.g. "/search", "/v1/completions"). Defaults to "/"./
methodNoHTTP method to use against the service. Defaults to GET.GET
bodyNoJSON request body (only used for POST/PUT/PATCH).
idempotencyKeyNoOptional idempotency key (UUID recommended). Identical keys within the proxy's retention window return the cached result without re-charging.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds significant behavioral context beyond annotations: it spends real money, is non-idempotent, has external side effects, returns upstream response verbatim, handles 402 as normal result, and requires specific env var. No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with sections (PRECONDITIONS, BEHAVIOR, Returns) and is front-loaded. Every sentence adds value, though it could be slightly more concise without losing meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with paid calls, external side effects, and preconditions, the description covers preconditions, behavior, error handling, idempotency, and return format. It lacks rate limits but is otherwise comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds meaningful context like serviceId must come from list_services, idempotencyKey for safe retry, and body only for certain methods, enhancing understanding beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool invokes an upstream API service through a pay-per-call proxy, specifying the verb and resource. It distinguishes itself from sibling tools (check_balance, check_tax, etc.) by focusing on paid external calls.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides PRECONDITIONS (env var, serviceId from list_services) and explains that 402 responses are returned normally for autonomous stop. However, it does not explicitly state when not to use the tool or compare directly with siblings, though sibling names imply differentiation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/evidai/lemon-cake'

If you have feedback or need assistance with the MCP directory API, please join our Discord server