Skip to main content
Glama

trace

Trace Go program execution to monitor function calls and performance using regex patterns, package filters, and optional stack depth analysis.

Instructions

Trace program execution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regexpYesRegular expression to match functions to trace
pkgNoPackage to trace (defaults to .)
ebpfNoUse eBPF for tracing (experimental)
stackNoShow stack trace with given depth
pidNoPid to attach to

Implementation Reference

  • Defines the input schema for the 'trace' tool, specifying parameters such as regexp (required), pkg, ebpf, stack, and pid.
    {
      name: "trace",
      description: "Trace program execution",
      inputSchema: {
        type: "object",
        properties: {
          regexp: {
            type: "string",
            description: "Regular expression to match functions to trace"
          },
          pkg: {
            type: "string",
            description: "Package to trace (defaults to .)"
          },
          ebpf: {
            type: "boolean",
            description: "Use eBPF for tracing (experimental)"
          },
          stack: {
            type: "number",
            description: "Show stack trace with given depth"
          },
          pid: {
            type: "number",
            description: "Pid to attach to"
          }
        },
        required: ["regexp"]
      }
    },
  • src/server.ts:406-407 (registration)
    Registers the 'trace' tool by routing CallTool requests for 'trace' to the handleDebugCommands function in debug.ts.
    if (["debug", "attach", "exec", "test", "core", "dap", "replay", "trace"].includes(name)) {
      return handleDebugCommands(name, args);
  • Type definition for DebugSession includes 'trace' as a valid session type.
    type: string; // 'debug' | 'attach' | 'exec' | 'test' | 'core' | 'replay' | 'trace' | 'dap'
Behavior2/5

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

With no annotations provided, the description carries full burden but only states 'Trace program execution', which is vague. It doesn't disclose behavioral traits such as whether this is read-only or mutative, if it requires specific permissions, potential side effects (e.g., performance impact), or output format. This leaves significant gaps in understanding how the tool behaves.

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 extremely concise with just three words, 'Trace program execution', which is front-loaded and wastes no words. Every part of the phrase contributes to the core purpose, making it efficient despite its brevity.

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

Completeness2/5

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

Given the complexity of a tracing tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It fails to explain what 'tracing' entails in this context, expected outputs, or behavioral implications, leaving the agent with insufficient information to use the tool effectively beyond basic parameter input.

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 description coverage is 100%, so the schema fully documents all 5 parameters. The description adds no additional meaning beyond the schema, as it doesn't explain parameter interactions, defaults (e.g., 'pkg' defaults to '.'), or usage examples. Baseline is 3 since the schema handles parameter documentation adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Trace program execution' states a general purpose but lacks specificity about what 'trace' entails in this context. It distinguishes from siblings like 'debug' or 'step' by focusing on tracing rather than debugging operations, but doesn't specify what resource or scope is being traced (e.g., functions, calls, execution flow).

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives like 'debug', 'step', or 'attach'. The description implies it's for tracing execution, but doesn't specify scenarios, prerequisites, or exclusions, leaving the agent to infer usage from the tool name alone.

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/dwisiswant0/delve-mcp'

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