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

get_schema

Retrieve schema and structure information for span recordings, including available fields, example payloads, and filter options for common instrumentation types like HTTP, database queries, and gRPC.

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

  • Handler function for the get_schema tool. Parses input via parseGetSchemaInput, calls client.getSchema(), and formats the result (description, commonJsonbFields, inputSchema, outputSchema, exampleSpanRecording) into a text response.
    export async function handleGetSchema(
      client: TuskDriftApiClient,
      args: Record<string, unknown>
    ): Promise<{ content: Array<{ type: "text"; text: string }> }> {
      const input = parseGetSchemaInput(args);
      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.",
          },
        ],
      };
    }
  • Zod schema (getSchemaInputSchema) defining input validation for get_schema: observableServiceId, packageName, instrumentationName, name, showExample (default true), maxPayloadLength (default 500).
    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"),
    });
  • parseGetSchemaInput function that validates args against getSchemaInputSchema and creates a SharedGetSchemaRequest protobuf message.
    export function parseGetSchemaInput(args: Record<string, unknown>): GetSchemaInput {
      const input: GetSchemaArgs = getSchemaInputSchema.parse(args);
      return SharedGetSchemaRequest.create({
        observableServiceId: input.observableServiceId ?? "",
        packageName: input.packageName,
        instrumentationName: input.instrumentationName,
        name: input.name,
        showExample: input.showExample,
        maxPayloadLength: input.maxPayloadLength,
      });
    }
  • SchemaResult interface defining the response shape: inputSchema, outputSchema, exampleSpanRecording, commonJsonbFields (inputValue/outputValue string arrays), and description.
    export interface SchemaResult {
      inputSchema?: unknown;
      outputSchema?: unknown;
      exampleSpanRecording?: Partial<SpanRecording>;
      commonJsonbFields: {
        inputValue: string[];
        outputValue: string[];
      };
      description?: string;
    }
  • Registration of handleGetSchema in the toolHandlers map under the key 'get_schema'.
    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 must disclose behavioral traits. It describes the tool as returning schema information and examples, implying a read-only operation. However, it does not explicitly state non-destructiveness, auth requirements, or rate limits. The description is adequate but lacks explicit behavioral guarantees.

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 concise with about 10 sentences, well-structured with a clear opening statement, bullet points for use cases, and a list of common packages. Every sentence adds value, and the length is appropriate for the tool's complexity.

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 has 6 parameters and no output schema, the description is quite complete: it explains the purpose, use cases, common parameter values, and what the tool returns (schema info, examples). It could be improved by mentioning the format of the output or any limitations, but overall it provides sufficient context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema covers all 6 parameters with descriptions (100% coverage). The description adds value by listing common package names and their typical fields, which helps parameter selection. The schema descriptions are clear, so the description provides additional context rather than being essential for understanding parameters.

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: 'Get schema and structure information for span recordings on Tusk Drift.' It explains what the tool returns (fields, example payloads) and distinguishes it from sibling tools like query_spans and aggregate_spans by focusing on metadata rather than data retrieval.

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

Usage Guidelines4/5

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

The description explicitly lists three use cases (understand available fields, see example payloads, learn what to filter on) and provides common package names with relevant fields. It does not explicitly mention when not to use or provide alternatives, but the use cases are clear and sufficient for most agents.

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