Skip to main content
Glama
evidai

πŸ‹ LemonCake β€” Billing & budgets for AI agents

call_service

Invoke an API service and automatically pay per call using USDC. Direct wallet-to-provider transfer via LemonCake proxy.

Instructions

Invoke an upstream API service through LemonCake's pay-per-call proxy. Each successful call automatically debits USDC from your wallet via the permit you signed. LemonCake never holds your USDC β€” the transfer is direct wallet β†’ provider on Base.

PRECONDITIONS: β€’ LEMON_CAKE_PERMIT env var must be set for real services. Get one in ~30 seconds at https://lemoncake.xyz/start/v2 (sign in with Google, sign 1 EIP-712 permit, copy the blob). If missing, the tool returns a structured PERMIT_MISSING error with how-to-fix steps. β€’ DEMO MODE: any serviceId starting with demo_ works WITHOUT a permit and hits real free upstreams (Wikipedia / httpbin / Open-Meteo / Nominatim / MyMemory / dictionaryapi / worldtimeapi / open.er-api). 8 demos cover search / echo / fx / translate / weather / geocode / time / dictionary β€” useful for Glama Inspector or new-user trial. They are marked with mode: "demo" and incur no charge. β€’ 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 daily $25 permit cap 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.

x402-COMPATIBLE INTERFACE: β€’ Successful calls include an x402Receipt field with { scheme, chain, asset, amount, recipient, paymentIntentId, settledAt }. Same shape as on-chain x402 receipts so the agent's payment-handling logic is portable. β€’ If upstream returns an x402 challenge (WWW-Authenticate: x402, X-402-* headers, or body.x402), it's parsed into x402Challenge for the agent to reason about. β€’ If upstream returns 202 + Retry-After + X-Payment-Status: pending, the result is { status: "PAYMENT_PENDING", paymentIntentId, retryAfterMs, retryContract }. Re-call with the same idempotencyKey to resume β€” no double-charge.

Returns: { status, chargeId, amountUsdc, response, x402Receipt?, x402Challenge?, hint? }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyNoJSON request body (only used for POST/PUT/PATCH).
pathNoSub-path on the service (e.g. "/search", "/v1/completions"). Defaults to "/"./
methodNoHTTP method to use against the service. Defaults to GET.GET
serviceIdYesID of the service to call (obtain from list_services).
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?

Description elaborates on behavioral traits beyond annotations: it details payment mechanics, HTTP 402 handling, idempotency via key, x402 interface, and demo mode. It confirms non-idempotent, external side effects, and spending moneyβ€”fully consistent 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?

Description is well-structured into sections (Preconditions, Behavior, x402-COMPATIBLE INTERFACE, Returns) and front-loads the core purpose. It is somewhat lengthy due to the tool's complexity, but each sentence adds value. Minor redundancy could be trimmed.

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?

Given no output schema, the description fully explains the return format and error states (PERMIT_MISSING, HTTP 402, payment pending). It covers all aspects: preconditions, behavior, demo mode, x402 handling, and retry logic. No gaps.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents each parameter well. The description adds context like idempotencyKey retry logic and serviceId sourcing, but does not significantly enhance per-parameter understanding beyond what the schema provides.

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: 'Invoke an upstream API service through LemonCake's pay-per-call proxy.' This specific verb+resource, combined with detailed behavioral context, distinguishes it from sibling tools like check_balance, list_services, and setup.

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?

Description provides explicit preconditions (LEMON_CAKE_PERMIT env var, demo mode, serviceId from list_services) and behavior (spends money, external side effects). It indirectly guides when to use this tool vs alternatives by stating serviceId must come from list_services. Could be slightly more explicit about when not to use it, but is sufficient.

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