Skip to main content
Glama

compute_gqa_kv_cache

Read-onlyIdempotent

Calculate exact GQA KV-cache element counts and byte/GiB footprints across f16, bf16, q8_0, and q4_0 quantizations, with MHA comparison for memory sizing.

Instructions

Compute exact Grouped-Query Attention (GQA) KV-cache element counts (2 * layers * kv_heads * head_dim * tokens) and byte/GiB footprints across f16, bf16, q8_0, and q4_0 vs counterfactual Multi-Head Attention (MHA).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "compute_gqa_kv_cache"
  }
}

Input Schema

NameRequiredDescriptionDefault
presetNoOptional built-in model preset (used unless `num_layers` is explicitly supplied).qwen3-35b-a3b
head_dimNo
kv_quantNoq8_0
num_layersNo
num_kv_headsNo
context_tokensNo
counterfactual_mha_headsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds the calculation formula and quantization variants, but it omits how results are returned, whether values are broken out per quantization, and how preset overrides behave.

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 single-sentence description is dense and front-loaded with the core purpose and formula. It contains no filler, though the embedded formula and long variant list make it harder to parse than a slightly more structured version would be.

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?

For a seven-parameter calculator with no output schema and low schema coverage, the description gives a useful formula and output categories. It still leaves gaps around return structure, units beyond GiB, default behavior, and how preset selection interacts with explicit parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 14%, so the description must compensate. The formula clarifies the roles of layers, kv_heads, head_dim, and tokens, and the mention of f16/bf16/q8_0/q4_0 and MHA gives meaning to kv_quant and counterfactual_mha_heads, but it does not map these terms to parameter names or explain preset precedence in detail.

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 states a specific verb and resource: compute exact GQA KV-cache element counts and byte/GiB footprints. It includes the exact formula and names the quantization variants and the MHA counterfactual, so the tool’s scope is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explain when to use this tool versus alternatives, nor when to choose the built-in preset over explicit model parameters. Usage is only implied by the calculator-like purpose.

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

Deploy Server

Other Tools