Skip to main content
Glama
bishnubista

Vulnerable Notes MCP Server

by bishnubista

notes_summarize

Generate AI summaries of notes to extract key information quickly. Provide a title and optional custom instructions for tailored results.

Instructions

Generate an AI summary of a note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the note to summarize
customPromptNoCustom instructions for summarization

Implementation Reference

  • The handler implementation for the "notes_summarize" tool, which reads the note content and builds a prompt for summarization.
    case "notes_summarize": {
      const { title, customPrompt } = args as { title: string; customPrompt?: string };
      const filePath = getNotePath(title);
    
      if (!fs.existsSync(filePath)) {
        // VULNERABILITY: SAFE-T1801 - Leaks full path and working directory
        throw new Error(
          `Cannot summarize: Note not found.\n` +
          `Path: ${path.resolve(filePath)}\n` +
          `Working directory: ${process.cwd()}\n` +
          `Notes directory: ${path.resolve(NOTES_DIR)}`
        );
      }
    
      const content = fs.readFileSync(filePath, "utf-8");
    
      // VULNERABILITY: SAFE-T1301 - Prompt injection via customPrompt
      const prompt = buildSummaryPrompt(content, customPrompt);
    
      // In a real implementation, this would call an LLM
      // The vulnerability is the unsanitized prompt construction
      return {
        content: [{
          type: "text",
          text: `[Summary would be generated with prompt:]\n${prompt}`
        }],
      };
    }
  • The registration and schema definition for the "notes_summarize" tool.
      name: "notes_summarize",
      description: "Generate an AI summary of a note",
      inputSchema: {
        type: "object" as const,
        properties: {
          title: { type: "string", description: "Title of the note to summarize" },
          customPrompt: { type: "string", description: "Custom instructions for summarization" },
        },
        required: ["title"],
      },
    },
  • A helper function used by the handler to construct the summarization prompt.
    function buildSummaryPrompt(noteContent: string, customPrompt?: string): string {
      // BAD: Direct string concatenation allows prompt injection
      let prompt = `Please summarize the following note:\n\n${noteContent}`;
    
      if (customPrompt) {
        // BAD: Custom prompt from user is directly appended
        prompt += `\n\nAdditional instructions: ${customPrompt}`;
      }
    
      return prompt;
    }
Behavior2/5

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

With no annotations provided, the description carries full disclosure burden but fails to specify behavioral traits: it doesn't state whether the operation is read-only, what format the summary returns in, length constraints, or error handling if the title doesn't exist.

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 single sentence is appropriately front-loaded and contains no wasted words. However, extreme brevity contributes to underspecification—it earns points for efficiency but loses the opportunity to add necessary behavioral context.

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

Completeness3/5

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

For a 2-parameter tool with full schema coverage and no output schema, the description meets minimum viability by identifying the core operation. However, it lacks critical context about the return value (string? object? saved to note?) and side effects, which are essential given zero annotation coverage.

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 coverage is 100%, establishing a baseline of 3. The description mentions 'note' which loosely maps to the 'title' parameter, but adds no semantic context beyond the schema (e.g., examples of customPrompt usage or title format requirements).

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 uses a specific verb ('Generate') and resource ('AI summary of a note'), clearly distinguishing it from sibling tools like notes_read (which presumably returns raw content) and notes_create. However, it lacks explicit scope clarification (e.g., length, format of summary) that would make it a 5.

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?

No guidance provided on when to use this versus notes_read, or when customPrompt is necessary versus optional defaults. No mention of prerequisites like the note existing or potential costs/tokens for AI generation.

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/bishnubista/vulnerable-notes-mcp'

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