Skip to main content
Glama
RestDB

Codehooks.io MCP Server

by RestDB

uncap_collection

Remove the cap from a collection to enable unrestricted document insertion and modification without size limits.

Instructions

Remove cap from a collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesCollection to remove cap from

Implementation Reference

  • Zod schema for uncap_collection input validation: requires 'collection' (string) describing the collection to remove cap from.
    const uncapCollectionSchema = z.object({
        collection: z.string().describe("Collection to remove cap from"),
    });
  • src/index.ts:390-401 (registration)
    Registration of the 'uncap_collection' tool in the tools array with name, description, and input schema.
    {
        name: "uncap_collection",
        description: "Remove cap from a collection",
        schema: uncapCollectionSchema,
        inputSchema: {
            type: "object",
            properties: {
                collection: { type: "string", description: "Collection to remove cap from" }
            },
            required: ["collection"]
        }
    },
  • Handler for the 'uncap_collection' tool. Extracts 'collection' from args, builds a CLI command array with 'uncap-collection', project, space, and collection name, then executes via the coho CLI helper function.
    case "uncap_collection": {
        const { collection } = args as UncapCollectionArgs;
        const uncapArgs = [
            'uncap-collection',
            '--project', config.projectId,
            '--space', config.space,
            collection
        ];
        const result = await executeCohoCommand(uncapArgs);
        return {
            content: [
                {
                    type: "text",
                    text: result
                }
            ],
            isError: false
        };
    }
  • The executeCohoCommand helper function that executes the 'coho' CLI with the constructed arguments. Used by uncap_collection handler to run 'coho uncap-collection --project ... --space ... <collection>'.
    async function executeCohoCommand(args: string[]): Promise<string> {
        const safeArgs = ['coho', ...args, '--admintoken', '***'];
        console.error(`Executing command: ${safeArgs.join(' ')}`);
        try {
            const { stdout, stderr } = await execFile('coho', [...args, '--admintoken', config.adminToken], {
                timeout: 120000 // 2 minutes timeout for CLI operations
            });
            if (stderr) {
                // Sanitize stderr before logging to avoid token exposure
                const safeSterr = stderr.replace(new RegExp(config.adminToken, 'g'), '***');
                console.error(`Command output to stderr:`, safeSterr);
            }
            console.error(`Command successful`);
            const result = stdout || stderr;
            // Sanitize result to ensure admin token is not exposed
            return result ? result.replace(new RegExp(config.adminToken, 'g'), '***') : result;
        } catch (error: any) {
            // Comprehensive sanitization of all error properties to avoid admin token exposure
            const sanitizeText = (text: string): string => text ? text.replace(new RegExp(config.adminToken, 'g'), '***') : text;
    
            const sanitizedMessage = sanitizeText(error?.message || 'Unknown error');
            const sanitizedCmd = sanitizeText(error?.cmd || '');
            const sanitizedStdout = sanitizeText(error?.stdout || '');
            const sanitizedStderr = sanitizeText(error?.stderr || '');
    
            // Log sanitized error details
            console.error(`Command failed: ${sanitizedMessage}`);
            if (sanitizedCmd) console.error(`Command: ${sanitizedCmd}`);
            if (sanitizedStdout) console.error(`Stdout: ${sanitizedStdout}`);
            if (sanitizedStderr) console.error(`Stderr: ${sanitizedStderr}`);
    
            // Return sanitized error message
            const errorDetails = [sanitizedMessage, sanitizedStderr].filter(Boolean).join(' - ');
            throw new McpError(ErrorCode.InvalidRequest, `Command failed: ${errorDetails}`);
        }
    }
Behavior2/5

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

With no annotations, the description carries full burden for behavioral disclosure. It only states the action 'remove cap' without mentioning side effects, authentication needs, reversibility, or result behavior. This is insufficient 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.

Conciseness4/5

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

The description is a single sentence, efficiently conveying the action without waste. However, it may be too minimal, lacking detail that could be added without harming conciseness.

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?

Given the tool's simplicity (one parameter, no output schema), the description is minimally complete. However, the term 'cap' is not explained, leaving ambiguity about what exactly is being removed. Adequate but with gaps.

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 baseline is 3. The parameter description 'Collection to remove cap from' adds meaning beyond the parameter name, but the tool description itself does not provide additional parameter context.

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 'Remove cap from a collection' uses a specific verb ('Remove') and resource ('cap from a collection') clearly defining the tool's action. It implicitly distinguishes from sibling 'cap_collection' which does the opposite.

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 is provided on when to use this tool versus alternatives. There is no mention of prerequisites, when to avoid, or comparison with 'cap_collection' or other sibling tools.

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