Skip to main content
Glama

fenwick_2d

Maintains a 2D grid for point updates and rectangle sum queries, enabling cumulative-sum lookups across rows and columns.

Instructions

2D Fenwick tree for point updates and rectangle sum queries.

Input Schema

NameRequiredDescriptionDefault
colsYesNumber of columns
rowsYesNumber of rows
operationsYesArray of {type, row, col, row2?, col2?, value?} operations

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description must carry full behavioral burden. It doesn't mention that the tree is built from an initial grid (if any), whether updates/queries are interleaved via operations array, the order of operations, or performance characteristics. The reference to 'operations' hints at a batch interface but leaves details unstated.

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?

A single, well-structured sentence that is completely front-loaded and contains no wasted words. It efficiently conveys the tool's scope.

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?

No output schema exists, and there are no annotations, so the description should ideally explain what the operations array contains and how results are returned. It provides the essential concept but omits these details, making it minimally adequate for a 3-parameter tool with 100% schema coverage.

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 100%, and the schema itself documents rows, cols, and operations with fairly detailed descriptions. The tool description adds little beyond the schema; it implicitly references the operations parameter but doesn't elaborate on the operation types or format. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific data structure (2D Fenwick tree) and the supported operations (point updates, rectangle sum queries), which is more informative than the bare name. It doesn't distinguish this from siblings like fenwick_tree or fenwick_range, but it effectively conveys what the tool does.

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?

No guidance on when to use this versus other Fenwick tools (fenwick_tree, fenwick_range) or other computational geometry/data structure tools. The description only restates the algorithmic capability.

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