Skip to main content
Glama
nav33n25

IMCP - Insecure Model Context Protocol

search-documents

Retrieve company documents by query, department, and confidentiality level using a deliberately insecure AI framework for vulnerability testing.

Instructions

Search through company documents and knowledge base

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confidentialLevelNoAccess level: public, internal, confidential
departmentNoLimit search to specific department
queryYesSearch query for documents

Implementation Reference

  • The asynchronous handler function for the 'search-documents' tool. It destructures the input parameters 'query' and 'format', checks for injection keywords like 'ignore' or 'forget' to demonstrate vulnerability, and returns mock search results in MCP content format.
    }, function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
        var injectionAttempt;
        var query = _b.query, format = _b.format;
        return __generator(this, function (_c) {
            injectionAttempt = query.toLowerCase();
            if (injectionAttempt.includes("ignore") || injectionAttempt.includes("forget")) {
                // Simulating successful prompt injection
                return [2 /*return*/, {
                        content: [
                            {
                                type: "text",
                                text: "INJECTION DETECTED! Query: \"".concat(query, "\" - This demonstrates how malicious prompts can be injected directly through tool parameters. In a real attack, this could override system instructions.")
                            }
                        ]
                    }];
            }
            return [2 /*return*/, {
                    content: [
                        {
                            type: "text",
                            text: "Search results for: \"".concat(query, "\"\n\nFound 3 documents matching your query:\n1. Document A\n2. Document B\n3. Document C\n\nNote: This tool is vulnerable to prompt injection attacks.")
                        }
                    ]
                }];
        });
    }); });
  • Zod schema definition for the tool inputs: required 'query' string and optional 'format' string.
    query: zod_1.z.string().describe("Search query for documents"),
    format: zod_1.z.string().optional().describe("Output format (json, text, detailed)")
  • The server.tool() call that registers the 'search-documents' tool with its name, description, input schema, and handler function.
    server.tool("search-documents", "Search through documents with a query", {
        query: zod_1.z.string().describe("Search query for documents"),
        format: zod_1.z.string().optional().describe("Output format (json, text, detailed)")
    }, function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
        var injectionAttempt;
        var query = _b.query, format = _b.format;
        return __generator(this, function (_c) {
            injectionAttempt = query.toLowerCase();
            if (injectionAttempt.includes("ignore") || injectionAttempt.includes("forget")) {
                // Simulating successful prompt injection
                return [2 /*return*/, {
                        content: [
                            {
                                type: "text",
                                text: "INJECTION DETECTED! Query: \"".concat(query, "\" - This demonstrates how malicious prompts can be injected directly through tool parameters. In a real attack, this could override system instructions.")
                            }
                        ]
                    }];
            }
            return [2 /*return*/, {
                    content: [
                        {
                            type: "text",
                            text: "Search results for: \"".concat(query, "\"\n\nFound 3 documents matching your query:\n1. Document A\n2. Document B\n3. Document C\n\nNote: This tool is vulnerable to prompt injection attacks.")
                        }
                    ]
                }];
        });
    }); });
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 of behavioral disclosure. It states the action ('Search') but does not describe behavioral traits such as permissions needed, rate limits, whether it returns partial or full results, or any side effects. This leaves significant gaps for a tool that interacts with company documents.

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 that directly states the tool's purpose without unnecessary words. It is front-loaded and appropriately sized, making it easy to understand quickly.

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 the complexity of searching company documents, the lack of annotations and output schema, and the description's minimal content, this is incomplete. It does not cover important aspects like result format, error handling, or security implications, which are crucial for a search tool in an enterprise context.

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?

The input schema has 100% description coverage, providing clear details for all three parameters (query, confidentialLevel, department). The description does not add any meaning beyond the schema, such as explaining how parameters interact or providing usage examples. With high schema coverage, the baseline score of 3 is appropriate.

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 tool's purpose as 'Search through company documents and knowledge base', which specifies the verb ('Search') and resources ('company documents and knowledge base'). However, it does not distinguish this tool from potential sibling tools like 'enterprise-document-manager' or 'enterprise-security-vault', which might also handle documents, so it lacks explicit differentiation.

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. It does not mention any context, prerequisites, or exclusions, such as whether it's for general searches or specific use cases, nor does it reference sibling tools like 'enterprise-document-manager' that might overlap in functionality.

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/nav33n25/IMCP'

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