Skip to main content
Glama

end_span

End a previously started span and calculate its duration. The response includes the span name, elapsed time in milliseconds, and status.

Instructions

Close an open span. Computes duration from start_ms to now.

Args:
    span_id: The span_id returned by start_span().
    status:  'ok' | 'error'. Default: 'ok'.
    error:   Error message if status='error'. Optional.

Returns a summary line: '{name} — {duration_ms}ms [{status}]'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
span_idYes
statusNook
errorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

Discloses computation of duration and return format. However, no annotations exist and description doesn't cover error cases (e.g., invalid span_id) or idempotency, placing increased burden on the description.

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?

Extremely concise: two paragraphs, no filler. Purpose stated first, followed by parameter details and return format. Every sentence earns its place.

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?

Output schema implied by return format description. Covers core behavior. Slight gap: no mention of error handling or what happens if span_id is missing or already closed.

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 has 0% description coverage, but description provides docstring explaining each parameter (span_id from start_span, status defaults, error optional), adding significant value beyond raw 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?

Specific verb+resource: 'Close an open span' clearly states action and object. Distinguishes from sibling tools like start_span and get_spans.

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?

Clear context: provide span_id, optional status/error. Does not explicitly state when not to use or alternatives, but for a span closure tool it's 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/SVerITG/Metis'

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