Skip to main content
Glama

getProjectCommands

Retrieve merged command mappings for a specific project to understand available commands and their configurations.

Instructions

Return merged command mappings for a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNameYes

Implementation Reference

  • The inline handler function for the 'getProjectCommands' tool. It calls getMergedCommands to retrieve merged command mappings for the given project and returns the result as formatted JSON in the MCP response content.
    async ({ projectName }) => { const merged = await getMergedCommands(projectName); return { content: [{ type: "text", text: JSON.stringify({ projectName, commands: merged }, null, 2) }] }; }
  • The input schema definition for the tool, specifying a required 'projectName' string parameter using Zod validation.
    { title: "Get project commands", description: "Return merged command mappings for a project", inputSchema: { projectName: z.string() }
  • src/server.ts:383-394 (registration)
    The registration of the 'getProjectCommands' tool on the MCP server, including title, description, input schema, and inline handler.
    server.registerTool( "getProjectCommands", { title: "Get project commands", description: "Return merged command mappings for a project", inputSchema: { projectName: z.string() } }, async ({ projectName }) => { const merged = await getMergedCommands(projectName); return { content: [{ type: "text", text: JSON.stringify({ projectName, commands: merged }, null, 2) }] }; } );
  • Helper function that loads project command mappings from a JSON file and merges default commands with project-specific overrides.
    async function getMergedCommands(projectName: string): Promise<Record<string, string>> { const data = await loadJson<Record<string, Record<string, string>>>(PROJECT_COMMANDS_PATH, { default: {} }); return { ...(data.default || {}), ...(data[projectName] || {}) }; }

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/mr-wolf-gb/smart-shell-mcp'

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