Skip to main content
Glama

build_decision_clusters

Read-onlyIdempotent

Recomputes thematic L2 clusters over a decision store using an LLM, updating existing clusters by trigram similarity. Returns change statistics.

Instructions

Recompute the L2 thematic cluster overlay over the decision store using the configured LLM. Stable cluster ids: a fresh cluster whose title matches an existing one (trigram Jaccard >=0.8) updates the existing row in place. Mutates the cluster store; idempotent. Requires an active AI provider — returns a structured error otherwise. Returns JSON: { created, updated, removed, total_after, clusters, strategy_used }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_rootNoProject root to cluster (default: current project).
service_nameNoFilter input + scope of stored clusters to this subproject.
max_clustersNoHard cap on returned clusters (default: 8).
forceNoDrop existing clusters in scope before rebuilding (default: false).
dry_runNoCompute clusters but do not write to the DB (default: false).
Behavior1/5

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

The description contradicts annotations: annotations set readOnlyHint=true and destructiveHint=false, but the description explicitly states 'Mutates the cluster store' and 'idempotent'. This is a clear contradiction, so per rubric the score is 1. The description itself provides good transparency (idempotence, error on missing AI provider), but the inconsistency undermines trust.

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?

The description is concise at 4 sentences, each serving a clear purpose: purpose, stability/mutation, requirement, return format. No fluff or repetition, and the most critical information is front-loaded.

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?

The description covers the tool's core behavior, return format, error conditions, and mutation side-effects. The parameters are optional and fully described in the schema. The only minor gap is the lack of explanation of 'L2 thematic cluster overlay', but given the schema coverage and domain context, this is acceptable. The return format specification is a strong plus.

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?

The input schema has 100% coverage, so baseline is 3. The description adds value beyond the schema by explaining the cluster matching logic (trigram Jaccard >=0.8 for stable ids) and the effect of the 'force' and 'dry_run' parameters implicitly through the mutation and idempotence statements, lifting the score to 4.

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?

The description clearly states the tool's purpose: 'Recompute the L2 thematic cluster overlay over the decision store using the configured LLM.' This is a specific verb-resource combination, and it naturally distinguishes from sibling tools like 'get_decision_clusters' which retrieve existing clusters.

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?

The description implies when to use this tool (to recompute clusters) and notes that it requires an active AI provider. It does not explicitly discuss when not to use it or name alternatives, but the context of recomputation versus retrieval is clear enough for an AI agent to infer usage boundaries.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nikolai-vysotskyi/trace-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server