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'

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