Skip to main content
Glama
crazyrabbitLTC

Vibe-Coder MCP Server

get_document_path

Retrieve file paths for specific feature documentation by providing feature ID and document type to locate development resources.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureIdYes
documentTypeYes

Implementation Reference

  • The main handler function for the 'get_document_path' MCP tool. It validates the feature and document existence, maps the document type string to the DocumentType enum, and returns the default file path obtained from documentStorage.getDefaultFilePath.
    async ({ featureId, documentType }) => {
      try {
        // Check if the feature exists
        const feature = getFeature(featureId);
        if (!feature) {
          throw new Error(`Feature ${featureId} not found`);
        }
        
        // Map the string to DocumentType enum
        let docType: DocumentType;
        if (documentType === 'prd') {
          docType = DocumentType.PRD;
        } else if (documentType === 'implementation-plan') {
          docType = DocumentType.IMPLEMENTATION_PLAN;
        } else {
          throw new Error(`Invalid document type: ${documentType}. Expected 'prd' or 'implementation-plan'`);
        }
        
        // Check if the document exists
        if (!documentStorage.hasDocument(feature.id, docType)) {
          throw new Error(`Document of type ${documentType} not found for feature ${feature.id}`);
        }
        
        // Get the default file path for the document
        const filePath = documentStorage.getDefaultFilePath(feature.id, docType);
        
        // Get the document to check if it's been saved
        const document = documentStorage.getDocument(feature.id, docType);
        
        return {
          content: [{
            type: "text",
            text: `Document path: ${filePath}\nSaved to disk: ${document?.metadata.isSaved ? 'Yes' : 'No'}`
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: `Error retrieving document path: ${error instanceof Error ? error.message : String(error)}`
          }],
          isError: true
        };
      }
    }
  • Zod input schema defining parameters: featureId (string, min length 1) and documentType (string, min length 1).
    {
      featureId: z.string().min(1),
      documentType: z.string().min(1)
    },
  • Registration of the 'get_document_path' tool using server.tool() with name, input schema, and handler function.
    server.tool(
      "get_document_path",
      {
        featureId: z.string().min(1),
        documentType: z.string().min(1)
      },
      async ({ featureId, documentType }) => {
        try {
          // Check if the feature exists
          const feature = getFeature(featureId);
          if (!feature) {
            throw new Error(`Feature ${featureId} not found`);
          }
          
          // Map the string to DocumentType enum
          let docType: DocumentType;
          if (documentType === 'prd') {
            docType = DocumentType.PRD;
          } else if (documentType === 'implementation-plan') {
            docType = DocumentType.IMPLEMENTATION_PLAN;
          } else {
            throw new Error(`Invalid document type: ${documentType}. Expected 'prd' or 'implementation-plan'`);
          }
          
          // Check if the document exists
          if (!documentStorage.hasDocument(feature.id, docType)) {
            throw new Error(`Document of type ${documentType} not found for feature ${feature.id}`);
          }
          
          // Get the default file path for the document
          const filePath = documentStorage.getDefaultFilePath(feature.id, docType);
          
          // Get the document to check if it's been saved
          const document = documentStorage.getDocument(feature.id, docType);
          
          return {
            content: [{
              type: "text",
              text: `Document path: ${filePath}\nSaved to disk: ${document?.metadata.isSaved ? 'Yes' : 'No'}`
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: "text",
              text: `Error retrieving document path: ${error instanceof Error ? error.message : String(error)}`
            }],
            isError: true
          };
        }
      }
    );
  • Private helper method in DocumentStorage class that constructs the file path for a document based on feature ID, document type, root directory, and .md extension.
    private getDocumentPath(featureId: string, type: DocumentType): string {
      const featureDir = path.join(this.options.rootDir, featureId);
      const filename = `${type}.md`;
      return path.join(featureDir, filename);
    }
  • Public helper method that delegates to the private getDocumentPath method to retrieve the default file path for a document.
    public getDefaultFilePath(featureId: string, type: DocumentType): string {
      return this.getDocumentPath(featureId, type);
    }
  • Type definition enum for document types used in path generation and validation.
    export enum DocumentType {
      PRD = 'prd',
      IMPLEMENTATION_PLAN = 'implementation-plan'
    }
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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/crazyrabbitLTC/mcp-vibecoder'

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