Skip to main content
Glama
Zenobia000

VibeCoding System

by Zenobia000

provide-clarification

Generate precise clarification responses to user queries by analyzing question indexes and provided answers, enhancing clarity in AI-driven dialogue systems.

Instructions

Provide a clarification answer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
answerYes
questionIndexYes

Implementation Reference

  • Core handler logic for the 'provide-clarification' tool: processes user answer for a specific question index, updates the project clarification responses, saves the project state, and returns the next question or completion status.
    async provideClarification(
      questionIndex: number, 
      answer: string
    ): Promise<{ success: boolean; nextQuestion?: string; isComplete: boolean; message: string }> {
        const project = this.loadCurrentProject();
      if (!project) {
            throw new Error('No active project found. Please start clarification first.');
      }
    
      const clarificationResponse: ClarificationResponse = {
        question: DEFAULT_CLARIFICATION_QUESTIONS[questionIndex],
        answer,
        timestamp: new Date()
      };
    
        if (!project.clarificationResponses) {
            project.clarificationResponses = [];
        }
      project.clarificationResponses.push(clarificationResponse);
      project.updatedAt = new Date();
        this.saveCurrentProject(project);
    
      const nextIndex = questionIndex + 1;
      if (nextIndex >= DEFAULT_CLARIFICATION_QUESTIONS.length) {
        return {
          success: true,
          isComplete: true,
                message: `✅ Project clarification complete! You can now generate the PRD.`
        };
      }
    
      return {
        success: true,
            nextQuestion: DEFAULT_CLARIFICATION_QUESTIONS[nextIndex],
        isComplete: false,
            message: `✅ Answer recorded. Next question:`
        };
    }
  • MCP CallToolRequestSchema handler case for 'provide-clarification': validates input arguments using Zod, invokes the core provideClarification method, and formats the MCP response content.
    case 'provide-clarification': {
      const { questionIndex, answer } = z.object({
        questionIndex: z.number(),
        answer: z.string()
      }).parse(args);
      const result = await contextManager.provideClarification(questionIndex, answer);
      let text = result.message;
      if(result.nextQuestion) {
          text += `\n\nNext question: ${result.nextQuestion}`;
      }
      return { content: [{ type: 'text', text }] };
    }
  • Tool registration in ListToolsRequestSchema response: defines name, description, and input schema for 'provide-clarification'.
    {
      name: 'provide-clarification',
      description: 'Provide a clarification answer',
      inputSchema: {
        type: 'object',
        properties: {
          questionIndex: { type: 'number' },
          answer: { type: 'string' }
        },
        required: ['questionIndex', 'answer']
      }
    },
  • Input schema definition for the 'provide-clarification' tool, specifying questionIndex (number) and answer (string) as required properties.
    {
      name: 'provide-clarification',
      description: 'Provide a clarification answer',
      inputSchema: {
        type: 'object',
        properties: {
          questionIndex: { type: 'number' },
          answer: { type: 'string' }
        },
        required: ['questionIndex', 'answer']
      }
    },
Install Server

Other Tools

Related 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/Zenobia000/vibeCoding-mcp'

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