Skip to main content
Glama

get_instrumentation_help

Provides guidance for instrumenting code with OpenTelemetry traces and logs. Helps improve or create instrumentation by analyzing existing telemetry data or offering initial setup advice. Supports multiple programming languages and filepaths.

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
filepathNoPath to the file being instrumented
languageNoProgramming language of the code to instrument

Implementation Reference

  • The tool handler function. Fetches static instrumentation guidance, customizes with language and filepath parameters, returns as markdown text block, handles errors.
    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"); } }
  • Input schema using Zod for optional language and filepath parameters.
    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") });
  • Tool factory called and added to the array of tools registered with the MCP server via server.tool() in the subsequent loop.
    createInstrumentationGuidanceTool(api)
  • Factory function that defines the tool's name, description, schema reference, and handler function. Note: full handler excerpt abbreviated here; see handler location.
    export function createInstrumentationGuidanceTool(api: HoneycombAPI) { return { name: "get_instrumentation_help", description: "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.", schema: InstrumentationGuidanceSchema.shape, /** * Handles the instrumentation_guidance tool request * * @param params - The parameters for the instrumentation guidance * @returns A formatted response with instrumentation guidance */ 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"); } } }; }
  • Helper function that returns the static INSTRUMENTATION_GUIDANCE prompt template used by the tool handler.
    export function getInstrumentationGuidance(): string { return INSTRUMENTATION_GUIDANCE;

Other Tools

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

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