Skip to main content
Glama

init_project_rules

Generates or updates project specification files to define and manage project rules, ensuring clarity and consistency in project setup and modifications.

Instructions

Initialize project rules. Call this tool when the user requests to generate or initialize the project specification file, or if the user requests to change or update the project specification.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main asynchronous handler function for the 'init_project_rules' tool. It retrieves a prompt, ensures the rules file exists, appends the file path to the prompt, and returns it as tool content. Includes error handling.
    export async function initProjectRules() { try { // Get prompts from generator const promptContent = getInitProjectRulesPrompt(); // Ensure rules.md file exists in the DATA_DIR directory await ensureRulesFileExists(); // Output the path to the rules file to help users find it const rulesPath = getRulesFilePath(); // Return success response return { content: [ { type: "text" as const, text: promptContent + `\n\nRules file will be located at: ${rulesPath}`, }, ], }; } catch (error) { // Error handling const errorMessage = error instanceof Error ? error.message : "Unknown error"; return { content: [ { type: "text" as const, text: `Error initializing project rules: ${errorMessage}`, }, ], }; } }
  • Zod input schema for the 'init_project_rules' tool, defined as an empty object since the tool takes no parameters.
    export const initProjectRulesSchema = z.object({});
  • src/index.ts:325-331 (registration)
    Tool registration entry in the ListToolsRequest handler. Specifies the tool name, loads description from a Markdown template, and references the input schema.
    { name: "init_project_rules", description: loadPromptFromTemplate( "toolsDescription/initProjectRules.md" ), inputSchema: zodToJsonSchema(initProjectRulesSchema), },
  • src/index.ts:564-566 (registration)
    Dispatch case in the CallToolRequest handler's switch statement. Directly invokes the initProjectRules handler function without input validation (consistent with empty schema).
    case "init_project_rules": result = await initProjectRules(); return result;
  • src/index.ts:55-58 (registration)
    Import statement bringing in the initProjectRules handler function and its schema from projectTools.ts for use in the MCP server.
    import { initProjectRules, initProjectRulesSchema, } from "./tools/projectTools.js";

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/liorfranko/mcp-chain-of-thought'

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