Skip to main content
Glama

Birthday magic square generator

hopi_birthday_magic_square
Read-onlyIdempotent

Build Ramanujan's birthday magic square: a 4 x 4 grid whose top row is a date (day, month, first two digits of the year, last two digits) and whose rows, columns, diagonals and many other groups of four all add up to the same total. Pass date as YYYY-MM-DD (order dmy for day first, the UK way, or mdy for month first), or pass numbers as any four whole numbers instead. With neither, it uses today's local date. Returns the square, the magic total and every group of four cells that adds up to it, with cells as [row, column] counted from 1 at the top left. builtIn is true for the 44 groups that always work and false for lucky coincidences. hasNegative and hasRepeats flag squares that use negative or repeated numbers. Source: https://hopi.co.uk/birthday-magic-square/

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": "hopi_birthday_magic_square"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoThe date in YYYY-MM-DD format, for example 1887-12-22 for Ramanujan's birthday. Defaults to today when numbers is not given.
orderNodmy puts the day first (UK style, 22 12 18 87); mdy puts the month first (US style, 12 22 18 87)dmy
numbersNoInstead of a date: any four whole numbers from -999,999 to 999,999 for the top row, for example [22, 12, 18, 87]

Output Schema

NameRequiredDescriptionDefault
dateNo
orderNo
groupsNo
squareNo
numbersNo
summaryYes
magicSumNo
hasRepeatsNo
source_urlYesThe tool's page on hopi.co.uk (cite or open to check the figure)
extraGroupsNo
hasNegativeNo
builtInGroupsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description goes well beyond them: it discloses the return payload (square, magic total, every qualifying group of four), the meaning of builtIn (44 guaranteed groups vs lucky coincidences), the hasNegative/hasRepeats flags, and the 1-based [row, column] cell convention.

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?

Front-loaded with what the square is, then the input modes, then the return shape. It is information-dense rather than padded, though the single long paragraph and the trailing source URL make it slightly heavier than strictly necessary.

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?

Despite an output schema existing, the description explains the non-obvious return semantics (what builtIn means, what the groups represent, cell indexing), so an agent can interpret and present results correctly. Nothing an agent needs is missing.

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 the baseline would be 3, but the description adds real semantic value: it states date and numbers are mutually exclusive alternatives, that neither means today's date, and gives a concrete example of the dmy vs mdy top-row layout (22 12 18 87 vs 12 22 18 87).

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?

States a specific verb (build) and a precisely described resource: Ramanujan's 4x4 birthday magic square with a date as the top row. The property that rows, columns, diagonals and other groups of four sum to the same total distinguishes it clearly from any sibling calculator.

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?

Explicitly enumerates the three input modes — pass a date, pass four numbers instead, or omit both to use today's local date — and explains the dmy/mdy ordering choice. No sibling tool overlaps with it, so no alternative-routing language is needed, but usage conditions are stated plainly.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources