Skip to main content
Glama

Search the cortex

cortex_query
Read-only

Search the cortex (a reviewed knowledge base) and get answers that each show their source — a file, link, or document they came from. When the question turns on the user's or their team's preferences, history, decisions, projects, or past conversations, search this first: the user's approved memory is the source of truth for those, and your own recollection may be stale. If nothing trustworthy matches, the cortex says so instead of guessing — relay that honestly rather than answering from general knowledge.

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": {
      "q": "<q>"
    },
    "name": "cortex_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
qYesThe question or topic, in plain words.
tagNoOptional entity tag filter: only facts tagged with it answer (e.g. 'account:meridian' or 'meridian'). The search itself is unchanged — the tag prunes the results, like everything here, honestly.
kindNoOptional filter: only facts of one kind, e.g. company_fact, process, story, history, decision, capability, boilerplate.
top_kNoHow many answers to return at most (default 8).
tags_anyNoOptional: keep only facts carrying ANY of these tags.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/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, so safety is covered; the description adds the valuable behavioral promise that every answer carries its source (file, link, document) and that the cortex refuses to guess when nothing trustworthy matches. The one gap is that it does not describe result shape or pagination, though honest no-match behavior plus sourcing is well beyond what annotations convey.

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?

Three sentences, front-loaded with the core action and a source-transparency promise, then routing guidance, then the no-match contract. Some phrases such as 'relay that honestly rather than answering from general knowledge' are slightly repetitive of the earlier honesty framing but still earn their place as agent instructions.

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

Completeness3/5

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

No output schema exists, yet the description never describes the return format beyond 'answers that each show their source' — an agent cannot tell whether it gets a list, a count, or the matched tags. Combined with five parameters and no annotation coverage of auth or rate limits, the definition is adequate but leaves return-shape ambiguity.

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 coverage is 100%, so the schema already documents q, tag, kind, top_k, and tags_any in detail. The description adds only the framing that retrieval is question-driven rather than keyword-driven; it does not explain how tag versus tags_any combine or clarify kind values, so baseline 3 applies.

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?

States a specific verb and resource ('Search the cortex') and immediately characterizes the corpus as a reviewed knowledge base that returns sourced answers. This clearly distinguishes it from siblings like cortex_add_fact or cortex_retract, which mutate the knowledge base rather than query it.

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?

Explicitly says when to prefer this tool: when the question concerns the user's or team's preferences, history, decisions, projects, or past conversations, search this first because approved memory is the source of truth. It also gives a fallback instruction for the no-match case, and implicitly routes write-shaped needs to the siblings that add or retract facts.

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