Skip to main content
Glama

generate_spec

Create specification documents using AI to define requirements and structure for development projects based on user prompts and context.

Instructions

Generate a specification document using OpenAI O3 model

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDescription of what specification to generate
contextNoAdditional context or requirements
formatNoOutput format for the specificationmarkdown

Implementation Reference

  • Core handler implementation for 'generate_spec' tool. The GenerateSpecTool class defines the AI prompts and action name. The exported generateSpec function executes the tool.
    class GenerateSpecTool extends BaseAITool<SpecGenerationOptions> {
      protected getActionName(): string {
        return 'generating specification';
      }
    
      protected getSystemPrompt(args: SpecGenerationOptions): string {
        const { format = 'markdown' } = args;
        return `You are a technical specification writer. Generate detailed, clear, and actionable specifications based on the requirements provided. 
    ${format === 'structured' ? 'Output in a structured format with clear sections, requirements, and acceptance criteria.' : 'Output in clean markdown format.'}
    Focus on:
    - Clear objectives and goals
    - Detailed requirements (functional and non-functional)
    - Technical architecture and design decisions
    - Implementation approach
    - Success criteria and testing requirements
    - Edge cases and error handling`;
      }
    
      protected getUserPrompt(args: SpecGenerationOptions): string {
        const { prompt, context } = args;
        return `Generate a specification for: ${prompt}${context ? `\n\nAdditional context: ${context}` : ''}`;
      }
    }
    
    const tool = new GenerateSpecTool();
    
    export async function generateSpec(args: SpecGenerationOptions): Promise<CallToolResult> {
      return tool.execute(args);
    }
  • src/index.ts:29-41 (registration)
    Registers the 'generate_spec' MCP tool with input schema and handler reference.
    // Register generate_spec tool
    server.registerTool(
      'generate_spec',
      {
        description: 'Generate a specification document using OpenAI O3 model',
        inputSchema: {
          prompt: z.string().describe('Description of what specification to generate'),
          context: z.string().optional().describe('Additional context or requirements'),
          format: z.enum(['markdown', 'structured']).optional().default('markdown').describe('Output format for the specification'),
        },
      },
      async (args) => generateSpec(args)
    );
  • Type definition for input parameters of the generate_spec tool, matching the Zod schema.
    export interface SpecGenerationOptions {
      prompt: string;
      context?: string;
      format?: 'markdown' | 'structured';
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the OpenAI O3 model but doesn't describe what this tool actually does behaviorally - whether it makes API calls, has rate limits, requires authentication, returns structured data, or has any side effects. 'Generate' implies creation but lacks operational details.

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 with zero wasted words. It's appropriately sized for a tool with 3 parameters and gets straight to the point without unnecessary elaboration.

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?

For a tool with no annotations and no output schema, the description is insufficient. It doesn't explain what kind of specification document is generated, what the output looks like, whether this involves external API calls, or any operational constraints. The description leaves too many open questions for effective tool selection.

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 additional parameter semantics beyond what's in the schema - it doesn't explain how parameters interact or provide usage examples. Baseline 3 is appropriate when schema does the heavy lifting.

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 action ('Generate') and resource ('specification document'), and mentions the specific model ('OpenAI O3 model'), which provides good specificity. However, it doesn't differentiate from sibling tools like 'review_spec' or explain what type of specification document is generated.

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 like 'review_spec' or other sibling tools. There's no mention of prerequisites, appropriate contexts, or when not to use this tool.

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/jaggederest/mcp_reviewer'

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