Skip to main content
Glama
chzkyy

mcp-mongodb

by chzkyy

create_index

Membuat index pada koleksi untuk mempercepat query atau menegakkan unique constraint.

Instructions

Membuat index pada koleksi untuk mempercepat query atau menegakkan unique constraint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keysNoDefinisi kunci index. Contoh: {"email": 1} ascending, {"createdAt": -1} descending.
optionsNoOpsi index. Contoh: {"unique": true, "name": "email_unique", "expireAfterSeconds": 3600}.
databaseNoNama database tujuan. Opsional jika MONGODB_DB sudah diatur.
collectionYesNama koleksi.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
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 only states the intended effect and does not mention side effects, failure conditions (e.g., duplicate keys when unique is true), whether creation is idempotent, background vs. blocking behavior, or required permissions.

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 concise sentence with no redundant wording, and the core action is front-loaded. It could be slightly more structured by adding a usage example or sibling reference, but it is appropriately brief.

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?

For a mutating tool with no annotations and no output schema, the description is too sparse. It omits how to verify the index was created, what happens with existing data when a unique index is enforced, and when the agent should prefer sibling tools like list_indexes or drop_index.

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 documents all parameters including examples for keys and options. The description adds no parameter-level meaning beyond the schema, which matches the baseline of 3.

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 verb ('Membuat' = create), the resource ('index pada koleksi'), and the intended purpose (speeding up queries or enforcing unique constraints). This distinguishes it from index-related siblings like list_indexes and drop_index, though it does not explicitly name any sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The purpose clause 'untuk mempercepat query atau menegakkan unique constraint' implies when the tool is appropriate. However, there is no explicit guidance about when not to use it, such as checking existing indexes with list_indexes before creating, or handling cases where an index already exists.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.