Skip to main content
Glama

init_project_kb

Initialize a project-specific knowledge base with cloud or local storage to store debugging solutions and reusable skills as you work, enabling higher rate limits for cloud storage users.

Instructions

Initialize a project-specific knowledge base with cloud storage. Returns user_id to store for future contributions. Cloud storage users get 10x rate limits (1000/hour vs 100/hour).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesUnique project identifier (e.g., 'hivemind-mcp', 'my-app')
project_nameYesHuman-readable project name
storage_typeNoStorage type: 'cloud' (10x limits) or 'local' (default limits)

Implementation Reference

  • The core handler function for the 'init_project_kb' tool. Makes a POST request to the backend API (/init-project) to initialize a project-specific knowledge base, handling cloud or local storage types.
    export async function initProjectKB(
      projectId: string,
      projectName: string,
      storageType: 'cloud' | 'local' = 'cloud'
    ): Promise<InitProjectResult> {
      const response = await fetch(`${API_BASE}/init-project`, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          project_id: projectId,
          project_name: projectName,
          storage_type: storageType
        }),
      });
    
      if (!response.ok) {
        throw new Error(`Init project failed: ${response.statusText}`);
      }
    
      return response.json();
    }
  • src/index.ts:124-147 (registration)
    Tool registration in ListToolsRequestHandler, defining the name, description, and input schema for 'init_project_kb'.
    {
      name: "init_project_kb",
      description:
        "Initialize a project-specific knowledge base with cloud storage. Returns user_id to store for future contributions. Cloud storage users get 10x rate limits (1000/hour vs 100/hour).",
      inputSchema: {
        type: "object",
        properties: {
          project_id: {
            type: "string",
            description: "Unique project identifier (e.g., 'hivemind-mcp', 'my-app')",
          },
          project_name: {
            type: "string",
            description: "Human-readable project name",
          },
          storage_type: {
            type: "string",
            enum: ["cloud", "local"],
            description: "Storage type: 'cloud' (10x limits) or 'local' (default limits)",
          },
        },
        required: ["project_id", "project_name"],
      },
    },
  • MCP server handler dispatch in CallToolRequestHandler switch statement. Extracts arguments and calls the initProjectKB function, returning the result as text content.
    case "init_project_kb": {
      const result = await initProjectKB(
        args?.project_id as string,
        args?.project_name as string,
        args?.storage_type as 'cloud' | 'local' | undefined
      );
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    }
  • Type definition for the return value of initProjectKB, defining the expected response structure from the backend API.
    interface InitProjectResult {
      success: boolean;
      user_id: string;
      project_id: string;
      project_name: string;
      storage_type: string;
      rate_limit: number;
      message: string;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses some behavioral traits: the tool returns a user_id and cloud storage users get 10x rate limits. However, it does not mention side effects like whether initializing an existing project overwrites data, or if special permissions are required, leaving gaps in transparency.

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

Conciseness5/5

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

The description is three concise sentences with no wasted words. The first sentence states the main purpose, the second instructs on the return value usage, and the third provides a key behavioral detail (rate limits). It is well-structured and front-loaded.

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

Completeness4/5

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

Given no output schema, the description appropriately explains the return value ('Returns user_id to store for future contributions'). It covers the core functionality and rate-limit consequence. However, it omits potential failure scenarios (e.g., duplicate project_id) and does not explain how the KB relates to sibling tools, so it is complete but not exhaustive.

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?

Schema coverage is 100%, so the baseline is 3. The description adds value by clarifying the storage_type parameter: 'Cloud storage users get 10x rate limits (1000/hour vs 100/hour)' explains the practical consequence of choosing cloud over local. It also notes the returned user_id should be stored for contributions, linking to project_id usage.

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

Purpose5/5

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

The description clearly states the tool's purpose with a specific verb and resource: 'Initialize a project-specific knowledge base with cloud storage.' This distinguishes it from sibling tools like search_kb or contribute_solution, and the mention of returning a user_id further clarifies its role.

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 provides clear context for when to use the tool (initializing a project-specific KB) and instructs the user to store the returned user_id for future contributions. However, it does not explicitly state exclusions or alternatives, such as when to prefer init_hive instead.

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