Skip to main content
Glama

digit_dp

Count integers from 1 to N whose digit sum equals a target value, using digit DP to handle large upper bounds.

Instructions

Count integers from 1 to N whose digit sum equals a target value using digit DP.

Input Schema

NameRequiredDescriptionDefault
nYesUpper bound (positive integer, max 1e15)
target_digit_sumYesTarget digit sum (0-135)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It is a deterministic pure-computation tool, so the implicit safety profile is benign, and 'using digit DP' hints at the algorithmic approach. However, it does not state that the result is a single integer count, whether N is inclusive, or anything about runtime scaling for the 1e15 bound.

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?

A single front-loaded sentence with the verb and the count condition first, and no wasted words. The trailing 'using digit DP' is mild implementation detail but does convey the approach, so it earns its place.

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?

For a two-parameter pure math function with full schema coverage and no output schema, the description covers what the tool computes and implicitly what it returns (a count). It could add inclusive/exclusive semantics for N, but nothing critical to calling it correctly is missing.

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%, so both parameters (n with its 1e15 cap, target_digit_sum with its 0-135 range) are already fully documented in the schema. The description only restates '1 to N' and adds no syntax, format, or edge-case meaning beyond that, so the baseline of 3 applies.

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?

States a specific verb ('Count') and a precisely bounded resource ('integers from 1 to N whose digit sum equals a target value'), which is enough for an agent to distinguish it from generic DP siblings like sos_dp or coin_change. It does not name an alternative or clarify boundaries against brute-force counting approaches, so it stops short of a 5.

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 never says when to prefer this over an alternative (e.g., direct enumeration) or what the valid operating context is. The usage is only implied by the purpose sentence; there are no explicit when/when-not conditions.

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