removeProjectCommand
Delete a command override for a specific project in the Smart Shell MCP Server to remove custom command mappings and restore default behavior.
Instructions
Delete a command override for a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectName | Yes | ||
| key | Yes |
Implementation Reference
- src/server.ts:416-419 (handler)The MCP tool handler for 'removeProjectCommand', which invokes the core logic function and formats the JSON response.async ({ projectName, key }) => { const res = await removeProjectCommand(projectName, key); return { content: [{ type: "text", text: JSON.stringify({ projectName, key, ...res }, null, 2) }] }; }
- src/server.ts:411-415 (schema)Input schema definition for the removeProjectCommand tool, specifying projectName and key parameters.{ title: "Remove a project command", description: "Delete a command override for a project", inputSchema: { projectName: z.string(), key: z.string() } },
- src/server.ts:409-420 (registration)Registration of the 'removeProjectCommand' tool using server.registerTool, including name, schema, and handler.server.registerTool( "removeProjectCommand", { title: "Remove a project command", description: "Delete a command override for a project", inputSchema: { projectName: z.string(), key: z.string() } }, async ({ projectName, key }) => { const res = await removeProjectCommand(projectName, key); return { content: [{ type: "text", text: JSON.stringify({ projectName, key, ...res }, null, 2) }] }; } );
- src/server.ts:184-190 (helper)Core helper function that performs the removal of a project command from the JSON storage, checking existence and saving changes.async function removeProjectCommand(projectName: string, key: string) { const data = await loadJson<Record<string, Record<string, string>>>(PROJECT_COMMANDS_PATH, { default: {} }); if (!data[projectName]) return { removed: false }; const existed = Object.prototype.hasOwnProperty.call(data[projectName], key); delete data[projectName][key]; await saveJson(PROJECT_COMMANDS_PATH, data); return { removed: existed };