Skip to main content
Glama

get_instrumentation_help

Get guidance for instrumenting code with OpenTelemetry traces and logs. Provides advice on improving existing instrumentation or creating new telemetry.

Instructions

Provides important guidance for how to instrument code with OpenTelemetry traces and logs. It is intended to be used when someone wants to instrument their code, or improve instrumentation (such as getting advice on improving their logs or tracing, or creating new instrumentation). It is BEST used after inspecting existing code and telemetry data to understand some operational characteristics. However, if there is no telemetry data to read from Honeycomb, it can still provide guidance on how to instrument code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageNoProgramming language of the code to instrument
filepathNoPath to the file being instrumented

Implementation Reference

  • The main execution logic for the 'get_instrumentation_help' tool. It retrieves a predefined instrumentation guidance template, customizes it with the provided language and filepath parameters, and returns it formatted as tool content. Errors are handled via handleToolError.
    handler: async (params: z.infer<typeof InstrumentationGuidanceSchema>) => { try { // Get the instrumentation guidance template const guidance = getInstrumentationGuidance(); const language = params?.language || "your code"; const filepath = params?.filepath ? ` for ${params.filepath}` : ""; return { content: [ { type: "text", text: `# Instrumentation Guidance for ${language}${filepath}\n\n${guidance}`, }, ], }; } catch (error) { return handleToolError(error, "get_instrumentation_help"); } }
  • Zod schema defining the optional input parameters 'language' and 'filepath' for the tool.
    export const InstrumentationGuidanceSchema = z.object({ language: z.string().optional().describe("Programming language of the code to instrument"), filepath: z.string().optional().describe("Path to the file being instrumented") });
  • The tool is instantiated via createInstrumentationGuidanceTool and added to the array of tools registered with the MCP server in the registerTools function.
    createInstrumentationGuidanceTool(api)
  • Helper function that returns the static string template containing OpenTelemetry instrumentation guidance, which is used by the tool handler.
    export function getInstrumentationGuidance(): string { return INSTRUMENTATION_GUIDANCE; }
  • The tool name is defined here in the returned tool object.
    name: "get_instrumentation_help",

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/honeycombio/honeycomb-mcp'

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