Skip to main content
Glama

Benchmark

benchmark

Measure algorithmic time complexity by running code at increasing input sizes and fitting growth curves to estimate Big-O notation.

Instructions

Empirically measure time complexity by running code at increasing input sizes.

Contract: the code must read an integer N from stdin (first line) and do work sized by N. codecalc runs it at each size in sizes and fits the growth curve to estimate Big-O (O(1), O(log n), O(n), O(n log n), O(n^2)...). Example python: 'import sys\nn=int(sys.stdin.readline()); s=0\nfor i in range(n): s+=i\nprint(s)'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesProgram that reads integer N from stdin's first line and does work sized by N
sizesNoComma-separated input sizes to run at, e.g. '100,1000,10000,100000'100,1000,10000,100000
timeoutNoWall-clock seconds allowed per size before that run is killed
languageNoLanguage `code` is written in; default 'python3'python3

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.12.0
    • addedInput schema / properties / code / description
      Added value: +"Program that reads integer N from stdin's first line and does work sized by N"
    • addedInput schema / properties / language / description
      Added value: +"Language `code` is written in; default 'python3'"
    • addedInput schema / properties / sizes / description
      Added value: +"Comma-separated input sizes to run at, e.g. '100,1000,10000,100000'"
    • addedInput schema / properties / timeout / description
      Added value: +"Wall-clock seconds allowed per size before that run is killed"
  2. Changed1 schema field changedv0.11.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "benchmarkDictOutput",
      +  "type": "object"
      +}
  3. Changed7 schema fields changedv0.2.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / code / title
      Added value: +"Code"
    • addedInput schema / properties / language / title
      Added value: +"Language"
    • addedInput schema / properties / sizes / title
      Added value: +"Sizes"
    • addedInput schema / properties / timeout / title
      Added value: +"Timeout"
    • addedInput schema / title
      Added value: +"benchmarkArguments"
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  4. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

The description discloses that user-supplied code is executed repeatedly at increasing input sizes and that results are fit to a growth curve. This goes beyond the annotations and gives the agent a clear model of what happens. It could mention side-effect risks of executing arbitrary code, but the annotations already flag non-readOnly, and the contract is explicit.

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 compact, front-loaded with the main purpose, and every sentence earns its place. The contract is stated crisply and the example is short but highly informative. No fluff or repeated schema content.

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

Completeness5/5

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

Given the presence of an output schema, the description does not need to explain return values. It covers the core contract, the execution model, the fitting behavior, and provides a concrete example. This is fully sufficient for an agent to invoke the tool correctly.

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?

Schema coverage is 100%, so baseline is 3, but the description adds real value beyond the schema by defining the stdin contract (read integer N from first line) and providing a working Python example. This clarifies exactly what 'code' must do, which the schema only implies.

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 opens with a specific verb+resource ('Empirically measure time complexity by running code at increasing input sizes') and clarifies the output (Big-O estimate). It clearly distinguishes this tool from static analysis or other execution tools by emphasizing empirical measurement via runs at multiple sizes.

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 states the intended use case clearly: measure empirical time complexity and estimate Big-O from actual runs. It gives a concrete contract and example, so an agent knows when to choose it. It does not explicitly name alternatives or exclusions, but the context is strong enough to route correctly.

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