Skip to main content
Glama

log_span

Record a completed span's duration in milliseconds with metadata, supporting tags and status, for retrospective performance logging.

Instructions

Record a completed span in one call (no separate start/end needed).

Useful for logging retrospective timing data (e.g. 'that DB query took 42ms').

Args:
    name:        Span label.
    duration_ms: How long the work took in milliseconds.
    kind:        'internal' | 'tool' | 'agent' | 'llm'. Default: 'internal'.
    session_id:  Session identifier. Optional.
    run_id:      FK to agent_runs. Optional.
    parent_id:   Parent span_id. Optional.
    status:      'ok' | 'error'. Default: 'ok'.
    tags:        JSON string of metadata. Optional.

Returns the new span_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
duration_msYes
kindNointernal
session_idNo
run_idNo
parent_idNo
statusNook
tagsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool records a span and returns a span_id, but does not discuss side effects, idempotency, permissions, or error behavior. This is adequate but not rich.

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?

The description is well-structured with a clear header, usage example, and parameter list. It is appropriately sized for 8 parameters, though slightly verbose with the example. Every sentence adds value.

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

Completeness3/5

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

Given the tool's simplicity (logging a span with 8 parameters, mostly optional), the description covers the core functionality and return value. However, it lacks information about error handling, duplicate detection, or authentication requirements, leaving minor gaps.

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?

Although the input schema lacks descriptions (0% coverage), the tool description includes a detailed Args section explaining each parameter (name, duration_ms, kind, etc.). This adds significant meaning beyond the schema, compensating well for the schema gap.

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 records a completed span in one call, distinguishing it from sibling tools like start_span and end_span. It uses a specific verb (Record) and resource (completed span), and provides an example of retrospective timing data.

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 explicitly states when to use the tool ('for logging retrospective timing data') and contrasts it with needing separate start/end calls, implying when not to use it. However, it does not explicitly name alternative tools or provide exclusionary guidance.

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_PH'

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