Skip to main content
Glama
RestDB

Codehooks.io MCP Server

by RestDB

create_index

Add fields to a query index for faster database queries by specifying the collection and index fields.

Instructions

Add field(s) to a query index

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesCollection name
indexYesField(s) to add to query index

Implementation Reference

  • Zod schema for the create_index tool inputs: defines 'collection' (string) and 'index' (string) as required parameters.
    const createIndexSchema = z.object({
        collection: z.string().describe("Collection name"),
        index: z.string().describe("Field(s) to add to query index"),
    });
  • src/index.ts:302-314 (registration)
    Tool registration entry in the tools array: name 'create_index', description 'Add field(s) to a query index', with inputSchema listing collection and index properties.
    {
        name: "create_index",
        description: "Add field(s) to a query index",
        schema: createIndexSchema,
        inputSchema: {
            type: "object",
            properties: {
                collection: { type: "string", description: "Collection name" },
                index: { type: "string", description: "Field(s) to add to query index" }
            },
            required: ["collection", "index"]
        }
    },
  • The handler for create_index tool execution: extracts collection and index args, builds a 'createindex' CLI command with project/space flags, executes via executeCohoCommand, and returns the result.
    case "create_index": {
        const { collection, index } = args as CreateIndexArgs;
        const indexArgs = [
            'createindex',
            '--project', config.projectId,
            '--space', config.space,
            collection,
            index
        ];
        const result = await executeCohoCommand(indexArgs);
        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 are present, and the description only states the basic action. It does not disclose whether the index creation is immediate, idempotent, or requires special permissions. Behavior beyond the action is opaque.

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

Conciseness3/5

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

The description is a single phrase, making it concise. However, it lacks structure—no front-loading of key information, and it does not separate purpose from usage details. It is functional but not well-organized.

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 tool has 2 required parameters and no output schema, the description is minimal. It does not explain return values, side effects, or the effect on existing indexes. For a mutation tool, this leaves significant 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 schema already explains the parameters. The description adds no additional meaning beyond what is in the schema, meeting the baseline for this dimension.

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 'Add field(s) to a query index' clearly states the verb and resource, distinguishing it from sibling 'drop_index'. However, it could be more specific about the scope (e.g., 'Create a new index on a collection with specified fields').

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 like 'query_collection' or 'add_schema'. There is no context about prerequisites, performance implications, or when not to use it.

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