Skip to main content
Glama

tune_weights

Adjust per-repo semantic weights by analyzing recent ranking events, gated by a minimum event threshold to prevent overfitting. Optionally preview changes with dry-run.

Instructions

Online weight tuning. Reads ranking_events from ~/.doc-index/telemetry.db (requires JDOCMUNCH_PERF_TELEMETRY=1) and proposes a per-repo semantic_weight step. dry_run=true skips the disk write. min_events gates against early overfitting. Learns from a recency window of the ledger (default 90 days) so stale events can't anchor the weights.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoNoOptional — single repo to tune. Omit to scan all repos with events.
dry_runNo
min_eventsNo
max_age_daysNoOnly learn from ledger events newer than this many days. Keeps stale events from anchoring weights to an outdated query distribution. 0 = lifetime ledger.
Behavior4/5

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

The description discloses the write behavior (skipped on dry_run), dependency on telemetry DB and environment variable, and learning behavior from a recency window. This adds context beyond the readOnlyHint=false annotation.

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 description is relatively concise, with the first sentence providing the main purpose. Additional sentences add necessary behavioral context without excessive verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While the description covers input parameters and behavior well, it lacks information about the return value or output shape. For a tool with no output schema, this leaves some ambiguity about what the agent can expect as a result.

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?

With 50% schema description coverage, the description compensates by explaining dry_run (skips disk write) and min_events (gates overfitting), and adds context for max_age_days. The repo parameter is also clarified.

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 is for online weight tuning of semantic weights per repo, using ranking events. It distinguishes itself from the predominantly doc-related sibling tools by its unique purpose.

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?

It explains key usage parameters like dry_run, min_events, and the recency window, and mentions the required environment variable. However, it does not explicitly state when this tool is preferred over alternatives or when not to use it.

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/jgravelle/jdocmunch-mcp'

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