Skip to main content
Glama

Give an agent flow a knowledge base to search

workbench_flows_attach_knowledge_base

Attaches a knowledge base to an AGENT flow's draft, the same way picking it in the agent editor does: a docs knowledge base becomes a search tool the model calls when a question needs it; a tabular one also puts its tables in the prompt and adds a query tool. The flow needs a system prompt (scaffold it with one). Attaching one that's already there changes nothing. Do it BEFORE workbench_flows_publish: a published version is what interfaces and schedules run, so attach, try it with workbench_flows_run, then publish — and if something already pins an older version (an interface grant), re-grant the new version. Tell the model in its system prompt what the knowledge base holds and when to search it. May return needs_confirmation.

Input Schema

NameRequiredDescriptionDefault
flowIdYesThe agent flow, from workbench_flows_scaffold or workbench_flows_list.
workspaceNoWorkspace slug. Personal tokens with no default workspace MUST pass this; tokens with a default can override per call. Ignored for workspace API keys.
approvalIdNoApproval id from a prior needs_confirmation response. Omit on the first call.
knowledgeBaseIdYesThe knowledge base id, from workbench_kb_create or workbench_kb_list.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

With annotations only declaring readOnly=false, destructive=false, this description carries real additional context: attaching an already-present KB is a no-op (idempotency), the operation may require a confirmation round-trip, and it describes the actual runtime effect on the model's tools and prompt. No contradiction with the annotation profile.

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?

Front-loaded with the core action and its two behavioral modes, then workflow ordering. Slightly dense as one paragraph and the interface re-grant aside is a bit of a tangent, but no sentence is 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?

No output schema exists, yet the description surfaces the one return value that matters operationally (needs_confirmation) and pairs it with the approvalId parameter, plus precondition and ordering. An agent has everything needed to invoke this correctly.

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 baseline is 3; the description adds meaning beyond the schema by explaining what the knowledgeBaseId choice entails (docs vs tabular behavior) and by tying approvalId to the needs_confirmation return. It stops short of describing workspace semantics, which the schema already handles well.

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+resource (attach a knowledge base to an AGENT flow's draft) and immediately explains the two distinct behaviors depending on KB type: docs KB becomes a search tool, tabular KB injects tables into the prompt plus a query tool. It distinguishes itself from siblings by naming workbench_flows_publish and workbench_flows_run, and from the workbench_kb_* family by scoping to flow attachment.

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 explicit sequencing: attach BEFORE publish, then try it with workbench_flows_run, then publish; plus the exception path (re-grant a newer version to anything pinning an older one, e.g. an interface grant). It also states a precondition (flow needs a system prompt, scaffold it) and multi-call mechanics (needs_confirmation / approvalId).

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