Skip to main content
Glama

Query Knowledge

kg_query

Search a shared knowledge graph by semantic similarity, type, status, or recency to retrieve ranked nodes and spreading-activation context; use read-only mode to avoid writes.

Instructions

Search knowledge by semantic similarity, type, status, or recency. Returns nodes ranked by relevance. Use spread=true to find related nodes via spreading activation. With an active session, returned nodes are reactivated (their usage-based decay score is boosted; node content is not changed); pass read_only=true to search without changing anything.

Input Schema

NameRequiredDescriptionDefault
textNoSemantic search query
typeNoOnly nodes of this type
limitYesMax nodes to return (1-100)
authorNoOnly nodes by this author
spreadYesEnable spreading activation
statusNoOnly nodes with this status
tenantNoOnly nodes of this tenant (defaults to your own)
projectNoOnly nodes in this project
read_onlyYesSkip implicit activation of returned nodes. The query then performs no writes: no decay_score change, no last_activated or session_activated update. For read-only consumers (dashboards, benchmarks) where observing must not reinforce. Send a JSON boolean or the literal string "true"; any other string coerces to false and the query will write.
spread_hopsYesHops for spreading (clamped 1-3)
include_edgesYesInclude edges between result nodes
spread_factorYesDecay factor per hop
include_relatedYesInclude directly related nodes
neighbors_limitYesMax neighbors per node
include_neighborsYesInclude neighbor references per node
activation_thresholdYesMin activation to include

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

The critical disclosure is that this is not a pure read: with an active session, returned nodes are reactivated and their decay score boosted, while node content is unchanged. That explains why annotations carry readOnlyHint=false with idempotentHint=false, which the description reinforces rather than contradicts. It stops short of stating the exact write fields (last_activated, session_activated), which only the schema covers.

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 tightly packed sentences that front-load the search purpose, then escalation guidance, then the side-effect warning. Every sentence earns its place; only the parenthetical could be trimmed slightly.

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 16-parameter tool with no output schema, the description covers the query modes, ranking, spreading activation, and the non-obvious write side effect. Minor gaps remain around the edge/neighbor inclusion flags and the limit, but those are fully specified in the schema, so an agent has what it needs to call correctly.

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 description coverage is 100%, so every parameter is already documented, including the read_only string-coercion caveat and enum values. The description adds conceptual meaning for spread and read_only but says nothing about the other 14 parameters, so it only marginally exceeds the schema baseline.

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 knowledge'), names the retrieval modes (semantic similarity, type, status, recency) and the return ('nodes ranked by relevance'). This is unambiguously the read/query tool among siblings like kg_node_create, kg_node_update, and kg_relate.

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 concrete conditional guidance: 'Use spread=true to find related nodes via spreading activation' and 'pass read_only=true to search without changing anything.' It lacks explicit when-not-to-use direction versus siblings (e.g., kg_meta_model), but the situational guidance for the two tricky flags is clear.

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