Skip to main content
Glama
Use-Tusk
by Use-Tusk

get_schema

Retrieve schema and structure information for span recordings to understand available fields, view example payloads, and identify filtering options before querying spans.

Instructions

Get schema and structure information for span recordings on Tusk Drift.

Use this tool to:

  • Understand what fields are available for a specific instrumentation type

  • See example payloads for HTTP requests, database queries, etc.

  • Learn what to filter on before querying spans

Common package names:

  • http: Incoming HTTP requests (has statusCode, method, url, headers)

  • fetch: Outgoing HTTP calls

  • pg: PostgreSQL queries (has db.statement, db.name)

  • grpc: gRPC calls

  • express: Express.js middleware spans

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
observableServiceIdNoService ID to query (required if multiple services available)
packageNameNoPackage name (e.g., 'http', 'pg', 'fetch')
instrumentationNameNoInstrumentation name
nameNoSpan name to filter by
showExampleNoInclude an example span
maxPayloadLengthNoTruncate example payload strings

Implementation Reference

  • The core handler function for the 'get_schema' tool. It validates the input using Zod schema, calls the API client's getSchema method, and formats the result into markdown sections for display.
    export async function handleGetSchema(
      client: TuskDriftApiClient,
      args: Record<string, unknown>
    ): Promise<{ content: Array<{ type: "text"; text: string }> }> {
      const input = getSchemaInputSchema.parse(args) as GetSchemaInput;
      const result = await client.getSchema(input);
    
      const sections: string[] = [];
    
      if (result.description) {
        sections.push(`## Description\n${result.description}`);
      }
    
      if (result.commonJsonbFields) {
        sections.push(`## Common Queryable Fields
    
    **inputValue fields:** ${result.commonJsonbFields.inputValue.join(", ") || "(none)"}
    
    **outputValue fields:** ${result.commonJsonbFields.outputValue.join(", ") || "(none)"}`);
      }
    
      if (result.inputSchema) {
        sections.push(`## Input Schema\n\`\`\`json\n${JSON.stringify(result.inputSchema, null, 2)}\n\`\`\``);
      }
    
      if (result.outputSchema) {
        sections.push(`## Output Schema\n\`\`\`json\n${JSON.stringify(result.outputSchema, null, 2)}\n\`\`\``);
      }
    
      if (result.exampleSpanRecording) {
        sections.push(`## Example Span\n\`\`\`json\n${JSON.stringify(result.exampleSpanRecording, null, 2)}\n\`\`\``);
      }
    
      return {
        content: [
          {
            type: "text",
            text: sections.join("\n\n") || "No schema information available.",
          },
        ],
      };
    }
  • Tool registration object defining the 'get_schema' tool, including its name, description, and JSON input schema for MCP.
    export const getSchemaTool: Tool = {
      name: "get_schema",
      description: `Get schema and structure information for span recordings on Tusk Drift.
    
    Use this tool to:
    - Understand what fields are available for a specific instrumentation type
    - See example payloads for HTTP requests, database queries, etc.
    - Learn what to filter on before querying spans
    
    Common package names:
    - http: Incoming HTTP requests (has statusCode, method, url, headers)
    - fetch: Outgoing HTTP calls
    - pg: PostgreSQL queries (has db.statement, db.name)
    - grpc: gRPC calls
    - express: Express.js middleware spans`,
      inputSchema: {
        type: "object",
        properties: {
          observableServiceId: {
            type: "string",
            description: "Service ID to query. Required if multiple services are available.",
          },
          packageName: {
            type: "string",
            description: "Package name to get schema for (e.g., 'http', 'pg', 'fetch')",
          },
          instrumentationName: {
            type: "string",
            description: "Specific instrumentation name",
          },
          name: {
            type: "string",
            description: "Span name to get schema for (e.g., '/api/users')",
          },
          showExample: {
            type: "boolean",
            description: "Include an example span with real data",
            default: true,
          },
          maxPayloadLength: {
            type: "number",
            description: "Truncate example payload strings to this length",
            default: 500,
          },
        },
      },
    };
  • Zod schema for validating inputs to the 'get_schema' tool, used in the handler for parsing arguments.
    export const getSchemaInputSchema = z.object({
      observableServiceId: z.string().optional().describe("Service ID to query (required if multiple services available)"),
      packageName: z.string().optional().describe("Package name (e.g., 'http', 'pg', 'fetch')"),
      instrumentationName: z.string().optional().describe("Instrumentation name"),
      name: z.string().optional().describe("Span name to filter by"),
      showExample: z.boolean().default(true).describe("Include an example span"),
      maxPayloadLength: z.number().min(0).default(500).describe("Truncate example payload strings"),
    });
  • Registration of all tools including 'get_schema' (via getSchemaTool) in the tools array exported for use in the main MCP server.
    export const tools: Tool[] = [
      querySpansTool,
      getSchemaTool,
      listDistinctValuesTool,
      aggregateSpansTool,
      getTraceTool,
      getSpansByIdsTool,
    ];
  • Mapping of tool names to their handler functions, including 'get_schema' to handleGetSchema, used by the MCP server.
    export const toolHandlers: Record<string, ToolHandler> = {
      query_spans: handleQuerySpans,
      get_schema: handleGetSchema,
      list_distinct_values: handleListDistinctValues,
      aggregate_spans: handleAggregateSpans,
      get_trace: handleGetTrace,
      get_spans_by_ids: handleGetSpansByIds,
    };
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 describes what the tool returns (schema information, example payloads) and its preparatory role for filtering before queries, which adds useful context. However, it doesn't disclose behavioral traits like rate limits, authentication needs, or whether it's read-only (though implied by 'Get'), leaving some gaps for a tool with no annotation coverage.

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 well-structured and appropriately sized. It starts with a clear purpose statement, followed by a bulleted list of use cases, and ends with examples of package names. Every sentence earns its place by adding value without redundancy, making it easy to scan and understand.

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

Completeness4/5

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

Given the tool's complexity (6 parameters, no output schema, no annotations), the description is fairly complete. It explains the tool's purpose, usage, and provides examples, but lacks details on output format or behavioral constraints. With no output schema, it could benefit from more information on return values, though the use cases imply schema and example data.

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 already documents all 6 parameters thoroughly. The description adds minimal parameter semantics by listing common package names (e.g., 'http', 'pg') and their fields, which provides context for the 'packageName' parameter but doesn't significantly enhance understanding beyond the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

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's purpose with specific verbs ('Get schema and structure information') and resources ('span recordings on Tusk Drift'). It distinguishes from siblings by focusing on schema/metadata rather than querying or aggregating actual span data, which is evident from sibling names like 'query_spans' and 'aggregate_spans'.

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

Usage Guidelines5/5

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

The description explicitly provides usage guidelines with a bulleted list: 'Use this tool to: - Understand what fields are available... - See example payloads... - Learn what to filter on before querying spans'. This clearly indicates when to use this tool (for schema exploration and preparation) versus alternatives like querying tools, though it doesn't name specific sibling alternatives.

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/Use-Tusk/drift-mcp'

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