Skip to main content
Glama

invoke

Executes a live API call to a specified endpoint using provided parameters and returns the response data, status code, and headers.

Instructions

invoke

Executes a real API call to an endpoint using the provided parameters and returns the response data, status code, and headers.

When to use

Use this tool only when the user explicitly asks to perform an action, such as:

  • "Get all pets" or "Create a user"

  • "Call the API" or "Make a request"

  • "Test the endpoint" or "Try it out"

Always use inspect first to understand the required parameters, headers, and request body before invoking.

Never invoke a destructive operation (POST/PUT/PATCH/DELETE) without explicit user confirmation.

Parameters

  • endpointId (required): The 32-character MD5 hash ID of the endpoint to invoke

  • parameters (optional): Object containing path, query, and header parameters as key-value pairs

  • requestBody (optional): The request body for POST/PUT/PATCH requests. Provide as a JSON object matching the schema from inspect

Returns

The API response data, HTTP status code, and response headers.

Large responses (over ~50 KB) are automatically saved to disk. You will receive a file path — use it to reference the result rather than displaying the full content inline.

Important

  • Auth is automatic: invoke handles authentication automatically. Do NOT pass headers or cookies — swag2mcp applies auth under the hood.

  • Auth-injected parameters are automatic: If inspect shows a required parameter that is an auth credential (e.g. api_key, timestamp, signature, recvWindow), do NOT pass it in parameters — swag2mcp injects it automatically. Only pass genuine business parameters.

  • One at a time, bounded retries: Make at most one outstanding invoke at a time — never launch a batch. If a call is rate_limit-ed, do not retry immediately or in a batch; back off (~15s, then ~30s) and retry that endpoint at most twice more, then mark it as "rate limited" and move on. Non-rate-limit errors are final — do not retry.

  • Rate limits: Before calling invoke in a loop, call info to check rate_limiting (per_endpoint_interval, global_limit). Respect these limits to avoid throttling.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointIdYesrequired,The 32-character MD5 hash ID of the endpoint to invoke
parametersNooptional,Path, query, and header parameters as key-value pairs
requestBodyNooptional,Request body for POST/PUT/PATCH requests
Behavior5/5

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

With no annotations provided, the description fully discloses behavioral traits: automatic auth, auth-injected parameters, large-response disk saving, one-at-a-time invocation, bounded retries, and rate-limit handling. This is extensive and far exceeds the minimum burden.

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

Conciseness5/5

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

The description is well-structured with clear headers, bullets, and front-loaded purpose. Every sentence serves a concrete purpose, with no redundancy or repetition of schema definitions.

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 the tool's complexity (dynamic endpoint invocation, auth, rate limits, large responses), the description covers all necessary aspects: when to use, prerequisites, parameter roles, auth, error handling, and rate limits. Without an output schema, it still explains return values and disk-saved responses adequately.

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

Parameters5/5

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

Schema coverage is 100%, but the description adds critical semantics: clarifies `parameters` includes path/query/header only, `requestBody` for POST/PUT/PATCH, and explicitly warns against passing auth-related params. This prevents common misuse and goes well 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 first sentence clearly states the tool executes a real API call and returns response data, status code, and headers. This distinguishes it from sibling tools like `inspect` and `info`, which are read/analysis tools, while `invoke` performs the actual action.

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

Usage Guidelines5/5

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

The 'When to use' section explicitly limits usage to explicit user action requests, provides example phrases, and mandates `inspect` first. It also excludes destructive operations without confirmation and points to `info` for rate-limit checks, offering clear alternatives.

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/mmadfox/swag2mcp'

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