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";
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions 'initialize' and 'change or update,' implying mutation, but doesn't disclose behavioral traits such as what 'project rules' entail, whether this is a destructive operation, what permissions are needed, or what the expected outcome is. This leaves significant gaps for a tool that likely modifies project state.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences that directly state the purpose and usage guidelines without unnecessary details. It's front-loaded and efficient, though slightly repetitive with 'project specification' mentioned twice, which prevents a perfect score.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a tool that likely involves mutation (based on 'initialize' and 'update'), the description is incomplete. It doesn't explain what 'project rules' are, how they relate to sibling tools like 'tasks,' or what the tool returns. This leaves the agent with insufficient information to use it effectively in context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter info, which is appropriate here, but it could have clarified if any implicit inputs (like project context) are required. Since there are no parameters, a baseline of 4 is justified, though not a 5 due to potential missing context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Initialize project rules' and mentions generating/initializing/changing/updating project specification files, which gives a general purpose. However, it doesn't specify what 'project rules' are or how they differ from related concepts like 'tasks' handled by sibling tools, making it somewhat vague rather than specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states '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.' This provides clear context for when to use it, though it doesn't mention when NOT to use it or directly compare to alternatives among the sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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