Skip to main content
Glama

palace_kg_query

Look up stable knowledge-graph facts for one entity, returning matching triples with direction, validity dates, confidence, and current status; use for durable facts like a project's database.

Instructions

Look up stable facts about one entity in the knowledge graph (subject → predicate → object triples added with palace_kg_add). Returns every matching fact with its direction, valid_from/valid_to dates, confidence, and whether it is still current. Read-only. Use it for durable facts such as 'which database does project X use'; use palace_search for free-text memories and palace_kg_timeline for a chronological history.

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": {
      "entity": "<entity>"
    },
    "name": "palace_kg_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
as_ofNoOnly return facts that were valid on this date, YYYY-MM-DD (optional; default returns current and ended facts)
entityYesEntity name to look up, e.g. a project, person or tool (matched case-insensitively)
directionNooutgoing = facts where the entity is the subject, incoming = where it is the object (default: both)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.20.7
    • changedInput schema / properties / as_of / description
      Previous value: -"Date filter (YYYY-MM-DD, optional)"New value: +"Only return facts that were valid on this date, YYYY-MM-DD (optional; default returns current and ended facts)"
    • changedInput schema / properties / direction / description
      Previous value: -"outgoing/incoming/both (default: both)"New value: +"outgoing = facts where the entity is the subject, incoming = where it is the object (default: both)"
    • addedInput schema / properties / direction / enum
      Added value: +[
      +  "outgoing",
      +  "incoming",
      +  "both"
      +]
    • changedInput schema / properties / entity / description
      Previous value: -"Entity to query"New value: +"Entity name to look up, e.g. a project, person or tool (matched case-insensitively)"
  2. First observedv0.20.5

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden; it declares 'Read-only' and discloses the returned fields (direction, valid_from/valid_to, confidence, current-ness), which is meaningful behavioral context. It stops short of stating result-size limits, truncation, or what happens when the entity has no facts, so the mutation/safety profile is clear but the operational envelope is not.

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?

Three tight sentences plus a one-word 'Read-only.'; purpose and scope are front-loaded, return shape follows, and sibling routing closes it out. No sentence is filler.

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?

With no annotations and no output schema, the description compensates well by enumerating the returned fields and noting read-only behavior. The remaining gap is operational detail — result limits, empty-result behavior, and how confidence values should be interpreted.

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% with per-parameter descriptions and an enum for direction, so the schema already does the heavy lifting. The description adds only that a single entity is queried and that facts include date validity, without elaborating on as_of or direction semantics beyond what the schema states — the 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 ('Look up stable facts about one entity in the knowledge graph') and pins the data model with 'subject → predicate → object triples added with palace_kg_add'. An agent can distinguish this from palace_kg_timeline and palace_search without opening any 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?

Gives a concrete positive example ('which database does project X use') plus explicit routing away to palace_search for free-text memories and palace_kg_timeline for chronological history. The when-to-use decision is fully resolved in the description.

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