Skip to main content
Glama

Vibe-Coder MCP Server

get_document_path

Retrieve the file path for specific documentation based on feature ID and document type, streamlining access to critical project resources within structured coding workflows.

Input Schema

NameRequiredDescriptionDefault
documentTypeYes
featureIdYes

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "documentType": { "minLength": 1, "type": "string" }, "featureId": { "minLength": 1, "type": "string" } }, "required": [ "featureId", "documentType" ], "type": "object" }

Implementation Reference

  • Registers the 'get_document_path' MCP tool with name, input schema, and inline 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 }; } } );
  • The core handler function that validates inputs, maps document type, retrieves the default file path using documentStorage, and returns the path along with save status.
    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 schema defining input parameters: featureId (string, min 1) and documentType (string, min 1).
    { featureId: z.string().min(1), documentType: z.string().min(1) },
  • Public helper method that returns the default file path for a document by delegating to private getDocumentPath.
    public getDefaultFilePath(featureId: string, type: DocumentType): string { return this.getDocumentPath(featureId, type); }
  • Private helper method that constructs the actual file path: rootDir/featureId/{type}.md
    private getDocumentPath(featureId: string, type: DocumentType): string { const featureDir = path.join(this.options.rootDir, featureId); const filename = `${type}.md`; return path.join(featureDir, filename); }

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

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