Skip to main content
Glama

OpenFactory

query_build_knowledge

Search the platform's proven build knowledge before inventing a fix.

Ask one focused query per recipe concept ("branding debian", "users autologin gdm", "installer calamares", ...) and one per new failure text. Make each a separate MCP invocation and read its result before the next; never batch queries in one shell call or concatenate their responses. A concept card comes back whole: every file that concept needs, with its template, slots and checks.

Tenant-scoped RAG over verified past fixes, feature/hook docs, and proven build documents, plus the verified learned-rule prose for the build's base image. Queries run as the BUILD OWNER, not the caller — guest builds run on system-owned harness keys, and querying as the system user would skip the owner's private knowledge tier. Read-only; the response is capped at 32KB.

For a recipe with a specific desktop, config_baseline is the certified config baseline for this base image and desktop (a commit to read with git show, or a line saying none exists): the same text prepare_iso_workspace returns as prior_knowledge, for a goal that was handed a Build ID and so never calls it. learned_rules and config_baseline come with a session's first call for the build only, unless include_learned_rules says otherwise; context_note says whether they were sent earlier, none were found, the read failed or learned_rules was truncated.

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": {
      "build_id": "<build_id>",
      "query": "<query>"
    },
    "name": "query_build_knowledge"
  }
}

Input Schema

NameRequiredDescriptionDefault
kNoMaximum evidence hits to return (capped at 12).
queryYesWhat you need to know — a failure summary, feature question, or capability you are about to implement.
api_keyNoOpenFactory MCP API key (optional).
build_idYesThe build whose knowledge scope to query.
session_tokenNoSession token from a previous tool response. IMPORTANT: Always pass the session_token from the most recent tool response to maintain session continuity.
include_learned_rulesNoAlso include learned_rules (previously VERIFIED remediations for this build's base image) and config_baseline. Default: only on this session's first call for this build; true repeats them, false omits them.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so well: it declares read-only behavior, a 32KB response cap, and the non-obvious auth model that queries execute as the BUILD OWNER rather than the caller because guest builds use system-owned harness keys. It also explains the first-call-only emission of learned_rules and config_baseline and that context_note reports whether they were sent, missing, failed, or truncated.

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?

The purpose and the query-splitting rule are front-loaded in the first two sentences, and the denser RAG/ownership paragraph follows. It is longer than typical, with heavy parentheticals and backticked identifiers, but nearly every sentence conveys distinct behavioral information rather than filler.

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?

For a 6-parameter RAG tool that already has an output schema, the description covers what an agent needs: query granularity, execution identity, size limits, and the conditional return of learned_rules and config_baseline. Nothing material is left to inference.

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 the schema already documents each field; the description nonetheless adds real meaning by framing query as one concept per call, explaining that config_baseline is the same text prepare_iso_workspace returns as prior_knowledge, and clarifying the include_learned_rules override. It adds value beyond the schema without re-documenting every parameter.

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?

Opens with a specific verb and resource: 'Search the platform's proven build knowledge before inventing a fix,' then sharpens it to 'Tenant-scoped RAG over verified past fixes, feature/hook docs, and proven build documents.' That scope statement clearly separates it from retrieval-adjacent siblings like get_build_evidence or get_build.

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 strong operational rules — one focused query per concept or failure text, one invocation each, read results serially, never batch or concatenate — plus a timing cue ('before inventing a fix'). It stops short of naming a sibling alternative or stating an explicit when-not-to-use case, so it lands just below the top.

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.