Skip to main content
Glama
RestDB

Codehooks.io MCP Server

by RestDB

cap_collection

Set a maximum document limit on a database collection to control storage size.

Instructions

Cap a collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesCollection name
capYesMaximum number of documents

Implementation Reference

  • Zod schema for cap_collection tool: defines input parameters (collection name and cap maximum document count).
    const capCollectionSchema = z.object({
        collection: z.string().describe("Collection name"),
        cap: z.number().describe("Maximum number of documents"),
    });
  • Handler case for cap_collection: builds CLI arguments and executes coho cap-collection command, returning stdout result.
    case "cap_collection": {
        const { collection, cap } = args as CapCollectionArgs;
        const capArgs = [
            'cap-collection',
            '--project', config.projectId,
            '--space', config.space,
            '--cap', cap.toString(),
            collection
        ];
        const result = await executeCohoCommand(capArgs);
        return {
            content: [
                {
                    type: "text",
                    text: result
                }
            ],
            isError: false
        };
    }
  • src/index.ts:377-389 (registration)
    Tool registration entry: defines the cap_collection tool with name, description, schema reference, and inputSchema for the tools/list response.
    {
        name: "cap_collection",
        description: "Cap a collection",
        schema: capCollectionSchema,
        inputSchema: {
            type: "object",
            properties: {
                collection: { type: "string", description: "Collection name" },
                cap: { type: "number", description: "Maximum number of documents" }
            },
            required: ["collection", "cap"]
        }
    },
  • Type inference helper: CapCollectionArgs type derived from the Zod schema.
    type CapCollectionArgs = z.infer<typeof capCollectionSchema>;
    type UncapCollectionArgs = z.infer<typeof uncapCollectionSchema>;
Behavior2/5

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

No annotations are provided, and the description does not disclose any behavioral traits (e.g., whether the action is destructive, reversible, or what happens to existing documents beyond the cap). This lack of transparency could lead to unexpected side effects.

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

Conciseness2/5

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

At six words, the description is extremely concise but at the expense of necessary context. It fails to clarify important behavioral aspects, making it under-specified rather than efficiently concise.

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?

With no annotations or output schema, the description should compensate by explaining return values, side effects, and prerequisites. It does not, leaving significant gaps for a mutation tool.

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% coverage with clear descriptions for both parameters ('Collection name' and 'Maximum number of documents'). The description does not add extra meaning beyond the schema, so baseline 3 is appropriate.

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 uses the verb 'Cap' which might be interpreted as setting a maximum limit, and the input schema confirms with a 'Maximum number of documents' parameter. However, 'cap' is somewhat jargon and not explicitly defined, making the purpose moderately clear but not universally understandable.

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 like 'uncap_collection'. Without context, an agent cannot differentiate the use case for capping a collection from other collection operations.

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/RestDB/codehooks-mcp-server'

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