Skip to main content
Glama

Create a search index

search_create_index
DestructiveIdempotent

Create a search index from typed fields, or from a first batch of documents (schema inferred). Use when the app needs search over its own records (products, articles, tickets). Before: search_list_indexes (needs search query access), to reuse an existing index. Returns the index with its idx_ id (replayed with the same idempotency_key and fields). Scope: search:write. Reuse the same idempotency_key on retry. Cost: priced at get_pricing; any price is reserved on the prepaid balance before the call. Refused for balance or a limit: follow next_action.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "products",
      "fields": [
        {
          "name": "title",
          "type": "text",
          "weight": 4
        },
        {
          "name": "description",
          "type": "text"
        },
        {
          "name": "brand",
          "type": "keyword",
          "facetable": true,
          "filterable": true
        },
        {
          "name": "price",
          "type": "number",
          "sortable": true,
          "filterable": true
        }
      ],
      "language": "en",
      "idempotency_key": "create-index-products"
    },
    "name": "search_create_index"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesIndex name: 1-63 chars, a-z 0-9 _ -, unique in the project.
fieldsNoThe fields: at least one searchable. Every document field must be declared here. Required unless `documents` is given.
languageNoText language: en, fr, or simple (no stemming). Default en.
documentsNoA first batch of documents, without `fields`: the schema is inferred from them and the batch is written in the same call, all or nothing.
typo_toleranceNoMatch small typos by default. Default true.
idempotency_keyYesUnique per request. Reuse it on retry.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already flag readOnlyHint=false, destructiveHint=true and idempotentHint=true, but the description adds substantial context beyond them: the required search:write scope, the fact that the index can be replayed with the same idempotency_key and fields, the return shape (idx_ id), that cost is priced at get_pricing and reserved against the prepaid balance before the call, and that balance/limit refusals are reported via next_action.

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?

Six short sentences, front-loaded with the action and mode choice, then usage, then prerequisites, then return/idempotency, then scope and cost, then failure handling. The telegraphic labels ('Before:', 'Scope:', 'Cost:') keep it scannable with no filler.

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?

For a mutating, billed, idempotent creation tool with no output schema, the description covers the missing pieces an agent needs: what is created, the two creation modes, permissions, cost reservation, idempotent replay, the returned identifier, and how refusals surface.

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 description coverage is 100%, so the baseline is 3, but the description adds value by framing the fields-vs-documents either/or mode that dominates the parameter design and by tying idempotency_key semantics to replay of the created index. It does not add field-level detail beyond the schema, which is fine since the schema already covers enums, patterns and limits.

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 first sentence names a specific verb and resource and distinguishes two creation modes: from typed fields or inferred from a first document batch. It also names the sibling it is not (search_list_indexes for reuse of an existing index), so an agent can route between them without opening either schema.

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?

It gives an explicit use condition ('when the app needs search over its own records'), a pre-step alternative ('Before: search_list_indexes ... to reuse an existing index'), a required permission precondition, retry guidance, and a fallback ('Refused for balance or a limit: follow next_action'). Nothing about when to call vs. avoid is left to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.