Skip to main content
Glama

create_function_run

Create a durable function run with an idempotency key to ensure work survives retries. Supports immediate, delayed, or scheduled execution with retry policy and expiry.

Instructions

Create a durable function run with a required idempotency key. Supports immediate, delayed, or run_at scheduling, expiry, retry policy, and optional wait. Use this instead of ad hoc cron/polling when work must survive retries or be redriven.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesFunction name to run
waitNoWait until the run becomes terminal before returning.
delayNoDelay before first attempt, such as `10m`, `1h`, or `3d`. Mutually exclusive with run_at.
retryNo
run_atNoAbsolute ISO-8601 first-attempt time. Mutually exclusive with delay/delay_seconds.
payloadNoJSON object payload delivered to the handler
event_typeYesApplication event type delivered to the function run handler
expires_atNoAbsolute ISO-8601 expiry time.
project_idYesThe project ID
timeout_msNoMaximum wait time in milliseconds.
delay_secondsNoDelay before first attempt in seconds. Mutually exclusive with delay and run_at.
expires_afterNoRelative expiry duration, such as `1d`.
idempotency_keyYesRequired idempotency key. Reuse it when retrying the same logical work item.
poll_interval_msNoPolling interval in milliseconds.
Behavior3/5

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

With no annotations, the description must disclose behavioral traits. It mentions idempotency key, scheduling options, expiry, retry policy, and optional wait, but lacks details on conflict handling (e.g., reusing idempotency key) and whether the call is synchronous or asynchronous. This is adequate but not fully transparent.

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?

Two focused sentences: the first states the core action and requirement (idempotency key), the second lists capabilities and usage context. No wasted words; essential information is front-loaded.

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?

Given the tool's complexity (14 parameters, nested retry object) and lack of output schema, the description covers the main behavioral aspects (idempotency, scheduling, expiry, retry, wait). It omits payload and event_type details, but these are in the schema. Overall, it is sufficiently complete for an agent.

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 high (93%), so the baseline is 3. The description adds context by grouping scheduling types (immediate, delayed, run_at) and mentioning retry policy, but does not significantly elaborate on individual parameters beyond what the schema already 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 the tool creates a durable function run, specifies the required idempotency key, and lists key features like scheduling, expiry, and retry policy. It distinguishes itself from siblings by contrasting with ad hoc cron/polling, making its purpose unambiguous.

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 description explicitly states 'Use this instead of ad hoc cron/polling when work must survive retries or be redriven,' providing clear guidance on when to choose this tool over alternatives. It also implies its suitability for durable, retryable work.

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