Skip to main content
Glama

query_index

Read-only

One read-only SQL (SQLite dialect) query over indexed markdown files. Every YAML header key is a column. scope: 'mine' = workspaces you belong to, 'store' = the store's listings (what /store shows), 'public' = every file in public workspaces, 'all' = yours and every public one, 'registry' = the registry itself (tables conventions, groups, cells, fields, roles); or one workspace_id. convention narrows to files that name it (e.g. 'local-services'; 0.70.0: no convention extends another; a file follows its own convention: header, else its workspace's). Tables: files (current versions: workspace_id, workspace, owner, visibility, convention, path, version, updated_at, issues, body, + one column per header field), links (connections agents recorded), fields (column dictionary with descriptions), workspaces. Start with: SELECT * FROM fields. Up to 1000 rows, 2 s.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sql": "<sql>"
    },
    "name": "query_index"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesOne read-only SQLite SELECT, e.g. "SELECT path, need FROM files WHERE can LIKE '%logo%'". Every YAML header key is a column of files.
scopeNoWhich files to cover: 'mine' (workspaces you belong to), 'store' (the store's listings, as /store shows them), 'public' (every file in public workspaces), 'all' (yours and every public one) or 'registry' (the registry itself: conventions, groups, cells, fields, roles).mine
api_tokenNoYour hashn API token, if you can't send it as the 'Authorization: Bearer <token>' header. Omit it when the header is set.
conventionNoOnly files following this convention (or one extending it), with its dimensions as columns.
workspace_idNoQuery one workspace only (instead of a scope).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / scope / description
      Previous value: -"Which files to cover: 'mine' (workspaces you belong to), 'store' (the store's listings, as /store shows them), 'public' (every file in public workspaces), 'all' (yours and every public one) or 'registry' (the registry itself: conventions, groups, cells, fields, aspects)."New value: +"Which files to cover: 'mine' (workspaces you belong to), 'store' (the store's listings, as /store shows them), 'public' (every file in public workspaces), 'all' (yours and every public one) or 'registry' (the registry itself: conventions, groups, cells, fields, roles)."
  2. Changed2 schema fields changed
    • changedInput schema / properties / scope / description
      Previous value: -"Which files to cover: 'mine' (workspaces you belong to), 'store' (the store's listings, as /store shows them), 'public' (every file in public workspaces) or 'all' (yours and every public one)."New value: +"Which files to cover: 'mine' (workspaces you belong to), 'store' (the store's listings, as /store shows them), 'public' (every file in public workspaces), 'all' (yours and every public one) or 'registry' (the registry itself: conventions, groups, cells, fields, aspects)."
    • changedInput schema / properties / scope / enum
      Previous value: -[
      -  "mine",
      -  "store",
      -  "public",
      -  "all"
      -]New value: +[
      +  "mine",
      +  "store",
      +  "public",
      +  "all",
      +  "registry"
      +]
  3. Changed2 schema fields changed
    • changedInput schema / properties / scope / description
      Previous value: -"Which files to cover: 'mine' (workspaces you belong to), 'store' (all public workspaces) or 'all'."New value: +"Which files to cover: 'mine' (workspaces you belong to), 'store' (the store's listings, as /store shows them), 'public' (every file in public workspaces) or 'all' (yours and every public one)."
    • changedInput schema / properties / scope / enum
      Previous value: -[
      -  "mine",
      -  "store",
      -  "all"
      -]New value: +[
      +  "mine",
      +  "store",
      +  "public",
      +  "all"
      +]
  4. Changed5 schema fields changed
    • addedInput schema / properties / api_token / description
      Added value: +"Your hashn API token, if you can't send it as the 'Authorization: Bearer <token>' header. Omit it when the header is set."
    • addedInput schema / properties / convention / description
      Added value: +"Only files following this convention (or one extending it), with its dimensions as columns."
    • addedInput schema / properties / scope / description
      Added value: +"Which files to cover: 'mine' (workspaces you belong to), 'store' (all public workspaces) or 'all'."
    • addedInput schema / properties / sql / description
      Added value: +"One read-only SQLite SELECT, e.g. \"SELECT path, need FROM files WHERE can LIKE '%logo%'\". Every YAML header key is a column of files."
    • addedInput schema / properties / workspace_id / description
      Added value: +"Query one workspace only (instead of a scope)."
  5. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, but the description adds genuinely non-redundant behavior: a 1000-row cap and a 2-second timeout, plus the single-statement constraint. It does not say what happens when the cap or timeout is hit (truncation vs. error), which is the one meaningful behavioral gap for a query tool.

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?

Front-loaded with the core operation and dense with useful facts rather than filler, using line breaks to separate scope, convention, and table inventory. It loses some efficiency by duplicating the scope enum definitions verbatim from the schema and by a somewhat run-on convention paragraph.

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?

With no output schema, the description compensates by naming the tables and the column set of files (workspace_id, owner, visibility, convention, path, version, updated_at, issues, body, plus header fields), so an agent can write a working query without guessing. Combined with the row/time limits and the suggested discovery query, nothing essential for correct invocation is missing.

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 baseline would be 3; the description earns a point by explaining convention semantics that the schema only gestures at — that narrowing matches files naming the convention, that no convention extends another as of 0.70.0, and that a file follows its own header else its workspace's. The scope enum meanings are largely restated from the schema, but the convention treatment adds real meaning.

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?

States a specific verb and resource: a single read-only SQLite query over indexed markdown files, with the key structural fact that every YAML header key becomes a column. It even enumerates the available tables (files, links, fields, workspaces). It does not explicitly contrast itself with siblings like export_index or get_convention, so an agent must infer that this is the ad-hoc query path.

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

Usage Guidelines4/5

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

Gives a concrete entry point ('Start with: SELECT * FROM fields'), which is real operational guidance for schema discovery, and explains how scope and convention narrow the search. It stops short of stating when NOT to use this tool or pointing to alternatives such as export_index for bulk retrieval, so exclusions and sibling routing are absent.

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.

Resources