Skip to main content
Glama
RestDB

Codehooks.io MCP Server

by RestDB

file_delete

Delete a single file by absolute path or multiple files using a regular expression. Optionally preview deletions without executing.

Instructions

Delete a file from server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameNoDelete file with match on absolute path/filename. Use this or 'match'.
matchNoDelete multiple files that match regular expression to a file path. Use this or 'filename'.
dryrunNoOutput files to delete without performing the action

Implementation Reference

  • Zod schema defining the input validation for file_delete. Accepts optional filename, match (regex), and dryrun fields.
    const fileDeleteSchema = z.object({
        filename: z.string().optional().describe("Delete file with match on absolute path/filename. Use this or 'match'."),
        match: z.string().optional().describe("Delete multiple files that match regular expression to a file path. Use this or 'filename'."),
        dryrun: z.boolean().optional().describe("Output files to delete without performing the action")
    });
  • src/index.ts:278-290 (registration)
    Registration of the 'file_delete' tool in the tools array with its name, description, and input JSON schema.
    {
        name: "file_delete",
        description: "Delete a file from server",
        schema: fileDeleteSchema,
        inputSchema: {
            type: "object",
            properties: {
                filename: { type: "string", description: "Delete file with match on absolute path/filename. Use this or 'match'." },
                match: { type: "string", description: "Delete multiple files that match regular expression to a file path. Use this or 'filename'." },
                dryrun: { type: "boolean", description: "Output files to delete without performing the action" }
            }
        }
    },
  • Handler implementation for file_delete. Extracts filename, match, and dryrun args, builds a 'file-delete' CLI command, and executes it via the Codehooks (coho) CLI helper.
    case "file_delete": {
        const { filename, match, dryrun } = args as FileDeleteArgs;
    
        if (!filename && !match) {
            throw new McpError(ErrorCode.InvalidRequest, "Either 'filename' or 'match' must be provided.");
        }
    
        const deleteArgs = [
            'file-delete',
            '--projectname', config.projectId,
            '--space', config.space
        ];
    
        if (filename) deleteArgs.push('--filename', filename);
        if (match) deleteArgs.push('--match', match);
        if (dryrun) deleteArgs.push('--dryrun');
    
        const result = await executeCohoCommand(deleteArgs);
        return {
            content: [
                {
                    type: "text",
                    text: result
                }
            ],
            isError: false
        };
    }
Behavior2/5

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

No annotations provided; description fails to mention irreversibility of deletion, ability to delete multiple files with 'match', or the effect of 'dryrun'. Behavioral context is insufficient.

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?

Single sentence, concise, no unnecessary words. Efficiently communicates core action.

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 no annotations, no output schema, and three parameters with diverse behaviors (filename vs match, dryrun), the description is too sparse. Lacks explanation of parameter interactions and safety warnings.

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%, covering all three parameters. Description adds no additional meaning beyond the schema, meeting baseline but not exceeding.

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?

Description clearly states 'Delete a file from server', specifying action and resource. Distinguishable from siblings like file_list or file_upload.

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 on when to use this tool versus alternatives like file_list or file_upload. Lacks context on prerequisites or conditions.

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