Skip to main content
Glama

kb_rules_set

Idempotent

Link an existing document as the rule doc for a scope. Pass scope=tenant|project|group, document_id, and (for project/group) owner_slug. The document is promoted to the matching rules kind and the scope's rule link is set to it. Idempotent. The document must live in the same tenant. Tenant-scope changes require admin; project/group require editor. Use kb_documents_update to edit the rule body.

Input Schema

NameRequiredDescriptionDefault
scopeYesWhich rule layer to address: tenant (workspace-wide), project, or group.
owner_slugNoSlug of the project or group that owns the rules. Required for project/group scope; ignored for tenant scope.
document_idYesId of the document to link as this scope's rule doc. Must be in the same tenant.
tenant_slugNoTenant slug to target. Required when your token grants several workspaces; omit when it grants one. If you omit it with several, the refusal names your default workspace; call kb_tenants_list to see every workspace the token grants.

Output Schema

NameRequiredDescriptionDefault
scopeYes
linkedYes
owner_slugNo
document_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing a real side effect the agent could not infer: the document is promoted to the matching rules kind. It also adds same-tenant constraints and per-scope authorization requirements, which annotations do not cover. The idempotent claim duplicates the annotation, but everything else is additive.

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?

Five short sentences, front-loaded with the action and followed by the mechanics, permissions, and the sibling pointer. Nothing is redundant with the schema and 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?

Covers action, side effect, authorization, tenant constraint, and a redirect for the adjacent operation, and an output schema exists so return values need not be described. An agent could invoke this correctly after one read.

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 value by packaging the call recipe ('scope=tenant|project|group, document_id, and (for project/group) owner_slug') into one line, making the conditional owner_slug requirement obvious at a glance. It does not mention tenant_slug or explain its multi-workspace behavior, which the schema carries alone.

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: 'Link an existing document as the rule doc for a scope', and immediately clarifies that this sets a link rather than editing content. The final sentence distinguishing it from kb_documents_update reinforces the boundary against the most confusable sibling.

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 prerequisites (document must live in the same tenant; tenant scope needs admin, project/group need editor) and redirects body editing to kb_documents_update. It stops short of naming kb_rules_unset as the inverse operation or stating when not to use this tool, so it is clear context rather than full when/when-not routing.

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.