Skip to main content
Glama

suggest_mongo_index

Generates MongoDB createIndex commands for specified fields, including compound and text variants, to eliminate collection scans and verify performance with explain queries.

Instructions

Generates the exact db.collection.createIndex() command for a MongoDB field, plus compound and text index variants and an explain query to verify. Call this when a collection scan is flagged by the analyzer or when writing a query that filters on an unindexed field. Does not check whether the index already exists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionYesMongoDB collection name
fieldYesField name to index
Behavior4/5

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

With no annotations, the description bears full burden. It discloses that the tool generates commands and does not execute them, and it does not check for existing indexes. This is transparent, though it could note that it is a suggestion-only tool with no 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.

Conciseness5/5

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

Three sentences, front-loaded with the core action, no unnecessary words. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the output (the command, variants, explain query) and usage context. Without an output schema, it sufficiently explains what the tool returns. It is complete for a suggestion tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so descriptions for 'collection' and 'field' are already present. The description adds context by mentioning compound and text index variants, indicating the tool's broader functionality beyond the schema.

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 clearly states the tool generates the exact db.collection.createIndex() command for a MongoDB field, including compound and text index variants and an explain query. It distinguishes itself from sibling tools like mysql_index_suggestions and postgres_index_suggestions by specifying MongoDB.

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

Usage Guidelines5/5

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

The description explicitly says when to call the tool: when a collection scan is flagged by the analyzer or when writing a query filtering on an unindexed field. It also mentions what it does not do (check if index already exists), providing clear guidance.

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/Sidd27/infrawise'

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