Skip to main content
Glama
aaronfeingold

MCP Project Context Server

Add Note

add_note

Add notes with content and category to projects in the MCP Project Context Server to maintain persistent project information between coding sessions.

Instructions

Add a note to the project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID
contentYesNote content
categoryNoNote category

Implementation Reference

  • The handler function for the 'add_note' MCP tool. It calls the context manager's addNote method and returns a standardized MCP response with success or error message.
    async ({ projectId, content, category }) => {
      try {
        await this.contextManager.addNote(projectId, content, category);
        return {
          content: [
            {
              type: "text",
              text: "Note added successfully",
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error adding note: ${
                error instanceof Error ? error.message : "Unknown error"
              }`,
            },
          ],
        };
      }
    }
  • Schema definition for the 'add_note' tool, including title, description, and Zod input schema for parameters.
    {
      title: "Add Note",
      description: "Add a note to the project",
      inputSchema: {
        projectId: z.string().describe("Project ID"),
        content: z.string().describe("Note content"),
        category: z.string().optional().describe("Note category"),
      },
    },
  • src/server.ts:279-314 (registration)
    Registration of the 'add_note' tool using server.registerTool, specifying name, schema, and handler.
    this.server.registerTool(
      "add_note",
      {
        title: "Add Note",
        description: "Add a note to the project",
        inputSchema: {
          projectId: z.string().describe("Project ID"),
          content: z.string().describe("Note content"),
          category: z.string().optional().describe("Note category"),
        },
      },
      async ({ projectId, content, category }) => {
        try {
          await this.contextManager.addNote(projectId, content, category);
          return {
            content: [
              {
                type: "text",
                text: "Note added successfully",
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error adding note: ${
                  error instanceof Error ? error.message : "Unknown error"
                }`,
              },
            ],
          };
        }
      }
    );
  • Helper method in ContextManager that implements the logic to add a note to the project's notes array and persist the update.
    async addNote(
      projectId: string,
      content: string,
      category?: string
    ): Promise<void> {
      const project = await this.store.getProject(projectId);
      if (!project) {
        throw new Error("Project not found");
      }
    
      project.notes.push({
        id: uuidv4(),
        content,
        category: category || "general",
        timestamp: new Date().toISOString(),
      });
    
      await this.store.updateProject(project);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Add a note' which implies a write operation, but doesn't disclose behavioral traits such as permissions required, whether notes are editable/deletable, rate limits, or what happens on success/failure. This is a significant gap for a mutation tool.

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 a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration.

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 this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like side effects, error handling, or return values, leaving significant gaps for an AI agent to understand how to use it correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all three parameters (projectId, content, category) with basic descriptions. The description adds no additional meaning beyond what the schema provides, such as format examples or constraints, meeting the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the action ('Add') and target ('note to the project'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'record_decision' or 'add_task', which might also involve adding content to projects, so it lacks sibling distinction.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'add_task', 'record_decision', and 'create_project', there's no indication of when a note is appropriate versus other types of project additions or updates.

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

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/aaronfeingold/mcp-project-context'

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