Skip to main content
Glama
gr3enarr0w

Claude Code Prompt Engineer

by gr3enarr0w

answer_questions

Provide answers to clarifying questions to continue prompt engineering for Claude Code, enabling interactive refinement of optimized prompts.

Instructions

Provide answers to clarifying questions and continue the prompt engineering process.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesThe session ID for this prompt engineering session
answersYesAnswers to the previously asked questions

Implementation Reference

  • Executes the answer_questions tool: validates args, retrieves session, incorporates answers as refinements, generates final optimized prompt using engineerPrompt, cleans up session, and returns the result.
    case "answer_questions": {
      if (!isAnswerArgs(args)) {
        throw new Error("Invalid arguments for answer_questions");
      }
      
      const { sessionId, answers } = args;
      const session = activeSessions.get(sessionId);
      
      if (!session) {
        throw new Error(`Session ${sessionId} not found`);
      }
      
      // Update session with answers
      session.refinements.push(...answers);
      
      // Generate final engineered prompt
      const engineeredPrompt = await engineerPrompt(
        session.originalPrompt, 
        session.language, 
        session.context.join('\n'), 
        session.refinements
      );
      
      // Clean up session
      activeSessions.delete(sessionId);
      
      return {
        content: [{ 
          type: "text", 
          text: `**Final Optimized Prompt for Claude Code:**\n\n${engineeredPrompt}\n\n**Are you ready to use this prompt?**`
        }],
        isError: false,
      };
    }
  • Tool object definition including name, description, and inputSchema (JSON Schema) for the answer_questions tool.
    const ANSWER_QUESTIONS_TOOL: Tool = {
      name: "answer_questions",
      description: "Provide answers to clarifying questions and continue the prompt engineering process.",
      inputSchema: {
        type: "object", 
        properties: {
          sessionId: {
            type: "string",
            description: "The session ID for this prompt engineering session"
          },
          answers: {
            type: "array",
            items: { type: "string" },
            description: "Answers to the previously asked questions"
          }
        },
        required: ["sessionId", "answers"],
        title: "answer_questionsArguments"
      }
    };
  • index.ts:570-572 (registration)
    Registers the answer_questions tool (via ANSWER_QUESTIONS_TOOL) in the list returned by ListToolsRequestSchema.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [ENGINEER_PROMPT_TOOL, ASK_CLARIFICATION_TOOL, ANSWER_QUESTIONS_TOOL, AUTO_OPTIMIZE_TOOL],  
    }));
  • Type guard function used to validate arguments for the answer_questions tool handler.
    function isAnswerArgs(args: unknown): args is {
      sessionId: string;
      answers: string[];
    } {
      return (
        typeof args === "object" &&
        args !== null &&
        "sessionId" in args &&
        typeof (args as { sessionId: string }).sessionId === "string" &&
        "answers" in args &&
        Array.isArray((args as { answers: string[] }).answers)
      );
    }
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 mentions providing answers and continuing a process, but lacks details on permissions, side effects, response format, or session management. This is inadequate for a tool with two required parameters and no output schema, leaving key behavioral traits unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the tool's function without unnecessary words. It is appropriately sized and front-loaded, though it could be more structured by explicitly separating purpose from guidelines.

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 with two required parameters, no annotations, and no output schema, the description is incomplete. It fails to explain return values, error handling, or how it integrates with sibling tools, leaving significant gaps for an AI agent to understand its full context and usage.

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 both parameters (sessionId and answers). The description adds no additional meaning beyond implying that answers are for clarifying questions in a prompt engineering context, which is minimal value. 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.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'provide answers to clarifying questions and continue the prompt engineering process,' which gives a vague purpose but doesn't specify what resource or action it performs beyond general continuation. It doesn't clearly distinguish from sibling tools like 'ask_clarification' or 'engineer_prompt,' leaving ambiguity about its specific role in the workflow.

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?

No explicit guidance on when to use this tool versus alternatives is provided. The description implies usage in a prompt engineering session with clarifying questions, but it doesn't specify prerequisites, exclusions, or how it differs from siblings like 'ask_clarification' or 'auto_optimize,' offering minimal direction for selection.

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/gr3enarr0w/cc_peng_mcp'

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