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, aspects); or one workspace_id. Store and public scopes also have axis_values: every listing's values per axis (place, price), whatever each convention calls the field. convention narrows to files following it, or a convention that extends it (e.g. 'local-services'; 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), file_versions (every version, + change), links (connections agents recorded), fields (column dictionary with descriptions), workspaces. Start with: SELECT * FROM fields. Up to 1000 rows, 2 s.

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, aspects).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. 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"
      +]
  2. 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"
      +]
  3. 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)."
  4. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, yet the description adds substantive operational constraints the annotations cannot convey: one statement only, read-only, a 1000-row cap, and a 2-second timeout. It also enumerates the queryable tables and their key columns, so the agent knows the shape of the environment before writing SQL.

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 core purpose is front-loaded well, but the body is a dense run-on with mid-phrase line breaks and stacked parentheticals that hurt scanability. Much of the scope enumeration restates the schema's own enum descriptions, so not every clause earns its place.

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

Completeness4/5

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

For a complex, free-form-SQL tool with no output schema, it covers the table model, scoping options, limits, and a recommended starting query — enough for an agent to construct a correct call. It stops short of describing what a result set looks like (row shape, error behavior on invalid SQL), which is the remaining gap.

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 would be 3, but the description adds semantics beyond the schema: convention inheritance rules ('a file follows its own `convention:` header, else its workspace's') and the fact that convention also matches extending conventions. scope semantics are largely duplicated from the schema, which caps this below 5.

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 states a specific verb and resource ('One read-only SQL (SQLite dialect) query over indexed markdown files') and immediately clarifies the data model ('Every YAML header key is a column'). It is unmistakably distinct from siblings like list_files, read_file, and export_index. An agent knows exactly what class of operation this is without opening the schema.

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?

It gives strong entry context ('Start with: SELECT * FROM fields') and spells out what each scope covers, which tells the agent which mode to pick. What is missing is an explicit contrast with siblings — e.g. 'use read_file for a single file, use this to filter across many' — so routing between this and the simpler read/list tools 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.

Resources