Skip to main content
Glama
raeseoklee

MCP Workbench MCP Server

by raeseoklee

generate_spec

Create YAML test specs by automatically discovering MCP server capabilities. Generate ready-to-run specifications for testing and validation.

Instructions

Generate a YAML test spec by discovering the capabilities of an MCP server. Returns a ready-to-run spec.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transportYesTransport type to use for connecting to the server
urlNoServer URL (required for streamable-http transport)
commandNoCommand to launch the server (required for stdio transport)
argsNoArguments to pass to the server command
headersNoHTTP headers to send (e.g. Authorization)
includeNoOnly include these capability types in the spec
excludeNoExclude these capability types from the spec
depthNoDiscovery depth: shallow (list only) or deep (call each tool/resource/prompt)
timeoutMsNoTimeout in milliseconds (default: 30000)

Implementation Reference

  • The main handler function for the generate_spec tool, which calls the CLI runner and formats the results.
    export async function generateSpec(
      input: GenerateSpecInput,
    ): Promise<GenerateSpecOutput> {
      const args = buildArgs(input);
      const result = await runCli(args, { timeoutMs: input.timeoutMs });
    
      const yaml = result.stdout;
      const testCount = countTests(yaml);
      const warnings = detectWarnings(yaml);
    
      const textParts = [`Generated spec \u2014 ${testCount} tests`];
      if (warnings.length > 0) {
        textParts.push("");
        textParts.push("Warnings:");
        for (const w of warnings) {
          textParts.push(`  - ${w}`);
        }
      }
    
      return {
        text: textParts.join("\n"),
        structured: { yaml, testCount, warnings },
      };
    }
  • Input and output type definitions for the generate_spec tool.
    export interface GenerateSpecInput {
      transport: "stdio" | "streamable-http";
      url?: string;
      command?: string;
      args?: string | string[];
      headers?: Record<string, string>;
      include?: Array<"tools" | "resources" | "prompts">;
      exclude?: Array<"tools" | "resources" | "prompts">;
      depth?: "shallow" | "deep";
      timeoutMs?: number;
    }
  • src/server.ts:58-118 (registration)
    Registration of the generate_spec tool within the MCP server's tool list.
    {
      name: "generate_spec",
      description:
        "Generate a YAML test spec by discovering the capabilities of an MCP server. Returns a ready-to-run spec.",
      inputSchema: {
        type: "object" as const,
        properties: {
          transport: {
            type: "string",
            enum: ["stdio", "streamable-http"],
            description: "Transport type to use for connecting to the server",
          },
          url: {
            type: "string",
            description:
              "Server URL (required for streamable-http transport)",
          },
          command: {
            type: "string",
            description:
              "Command to launch the server (required for stdio transport)",
          },
          args: {
            oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }],
            description: "Arguments to pass to the server command",
          },
          headers: {
            type: "object",
            additionalProperties: { type: "string" },
            description: "HTTP headers to send (e.g. Authorization)",
          },
          include: {
            type: "array",
            items: {
              type: "string",
              enum: ["tools", "resources", "prompts"],
            },
            description: "Only include these capability types in the spec",
          },
          exclude: {
            type: "array",
            items: {
              type: "string",
              enum: ["tools", "resources", "prompts"],
            },
            description: "Exclude these capability types from the spec",
          },
          depth: {
            type: "string",
            enum: ["shallow", "deep"],
            description:
              "Discovery depth: shallow (list only) or deep (call each tool/resource/prompt)",
          },
          timeoutMs: {
            type: "number",
            description: "Timeout in milliseconds (default: 30000)",
          },
        },
        required: ["transport"],
      },
    },
  • Helper function to convert input parameters into CLI arguments.
    export function buildArgs(input: GenerateSpecInput): string[] {
      const args = ["generate", "--stdout", "--transport", input.transport];
    
      if (input.command) {
        args.push("--command", input.command);
      }
      if (input.url) {
        args.push("--url", input.url);
      }
      if (input.args) {
        const argsValue = Array.isArray(input.args)
          ? input.args.join(" ")
          : input.args;
        args.push("--args", argsValue);
      }
      if (input.headers) {
        for (const [key, value] of Object.entries(input.headers)) {
          args.push("--header", `${key}: ${value}`);
        }
      }
      if (input.include && input.include.length > 0) {
        args.push("--include", input.include.join(","));
      }
      if (input.exclude && input.exclude.length > 0) {
        args.push("--exclude", input.exclude.join(","));
      }
      if (input.depth) {
        args.push("--depth", input.depth);
      }
      if (input.timeoutMs !== undefined) {
        args.push("--timeout", String(input.timeoutMs));
      }
    
      return args;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'discovers capabilities' and 'returns a ready-to-run spec,' but lacks details on permissions needed, rate limits, whether it's read-only or mutative, error handling, or what 'discovering' entails (e.g., network calls, timeouts). This is a significant gap for a tool with 9 parameters and complex behavior.

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 a single, efficient sentence that front-loads the core action and outcome. There's no wasted verbiage, and it's structured to immediately convey purpose. Every word earns its place, making it highly concise.

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

Completeness2/5

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

Given the tool's complexity (9 parameters, no annotations, no output schema), the description is insufficient. It doesn't cover behavioral aspects like safety, performance, or output format details, nor does it address usage context relative to siblings. For a tool that interacts with external servers and generates specs, more completeness is needed to guide effective use.

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 parameters thoroughly. The description adds no specific parameter semantics beyond implying discovery involves connecting to a server. It doesn't explain relationships between parameters (e.g., 'url' required only for 'streamable-http'), so it meets the baseline but doesn't enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: 'Generate a YAML test spec by discovering the capabilities of an MCP server.' It specifies the verb ('generate'), resource ('YAML test spec'), and method ('discovering capabilities'). However, it doesn't explicitly differentiate from sibling tools like 'run_spec' or 'inspect_server', which might have overlapping testing functions.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It mentions 'Returns a ready-to-run spec,' but doesn't specify prerequisites, when to choose this over siblings like 'run_spec' (which might execute the spec), or any exclusions. Usage is implied but not articulated.

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/raeseoklee/mcp-workbench-mcp-server'

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