Skip to main content
Glama

setProjectCommand

Configure custom shell commands for specific projects to adapt execution based on project type and environment.

Instructions

Add or update a project-specific command override

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNameYes
keyYes
valueYes

Implementation Reference

  • Core handler function that loads the project-commands.json, sets or updates the specified key-value for the project, saves it back, and returns the update.
    async function setProjectCommand(projectName: string, key: string, value: string) { const data = await loadJson<Record<string, Record<string, string>>>(PROJECT_COMMANDS_PATH, { default: {} }); if (!data[projectName]) data[projectName] = {}; data[projectName][key] = value; await saveJson(PROJECT_COMMANDS_PATH, data); return { projectName, key, value };
  • Input schema definition using Zod for the tool parameters: projectName, key, value as strings.
    inputSchema: { projectName: z.string(), key: z.string(), value: z.string() }
  • src/server.ts:396-407 (registration)
    MCP server registration of the 'setProjectCommand' tool, including name, metadata/schema, and thin wrapper handler that calls the core function and formats response.
    server.registerTool( "setProjectCommand", { title: "Set a project command", description: "Add or update a project-specific command override", inputSchema: { projectName: z.string(), key: z.string(), value: z.string() } }, async ({ projectName, key, value }) => { const res = await setProjectCommand(projectName, key, value); return { content: [{ type: "text", text: JSON.stringify(res, null, 2) }] }; } );

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