Skip to main content
Glama

invoke_function

Invoke a deployed serverless function via HTTP. Supports free direct calls and paid invocations with idempotency key, wait, and polling for results.

Instructions

Invoke a deployed function via HTTP. Free functions behave like the direct test path; paid functions require idempotency_key and may spend allowance, returning a result or pollable run_id. Stable errors preserve code and set isError=true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyNoRequest body (string or JSON object)
nameYesFunction name to invoke
waitNoWhen a paid invocation returns a 202 run handle, poll the run and replay the same idempotency key for the retained result.
methodNoHTTP method (default: POST)
headersNoAdditional headers to send
project_idYesThe project ID
timeout_msNoMaximum wait time in milliseconds when wait is true.
idempotency_keyNoStable Idempotency-Key required by paid function invocations. Reuse it for the same paid intent; use a new key only for a new paid intent.
poll_interval_msNoPolling interval in milliseconds when wait is true.
Behavior5/5

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

Beyond annotations (readOnlyHint=false, openWorldHint=true, idempotentHint=false, destructiveHint=false), the description adds valuable behavioral details: paid functions require idempotency_key, may spend allowance, return a result or pollable run_id, and handle stable errors by preserving code with isError=true. No contradictions.

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 concise (3 sentences) and front-loaded with the core action. Every sentence adds essential behavioral context without redundancy.

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

Completeness4/5

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

For a tool with 9 parameters and no output schema, the description covers key behavioral aspects (free vs paid, error handling, polling). It mentions return types (result or run_id) but lacks detail on response structure. Overall, sufficiently complete.

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 coverage is 100%, so baseline is 3. The description does not add new meaning to parameters beyond what schema descriptions already provide. It mentions idempotency_key and wait in context, but that is implicit from 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 it invokes a deployed function via HTTP, distinguishing free vs paid behavior. While sibling tool names like 'create_function_run' suggest different purposes, the description itself is specific and unambiguous.

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 clear guidance on when to use the tool by differentiating free vs paid functions and their requirements (idempotency_key, spending allowance). However, it does not explicitly contrast with similar siblings like 'create_function_run'.

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/MajorTal/run402'

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