Skip to main content
Glama
youngsu-Kim

macaulay2-mcp

by youngsu-Kim

m2_memory

Monitor the Macaulay2 kernel's memory (RSS, peak, swap, uptime) without affecting the session. Call it during long computations to decide if interruption is worthwhile.

Instructions

Report the persistent Macaulay2 kernel's memory: RSS, peak, swap, pid, uptime.

Reads the operating system's bookkeeping for the kernel child process — an unprivileged read; nothing is sent to M2 and the session is untouched. Peak comes from kernel-tracked counters (no sampler involved); swap is M2's own swapped pages on Linux, or the system-wide swap growth since this kernel started on macOS (no unprivileged per-process counter exists there). The probe is lock-free: call it WHILE a long m2_evaluate runs to watch memory live before deciding whether m2_interrupt is worthwhile. RSS reads as a high-water mark because M2 rarely returns freed pages to the OS.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.4

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly. It discloses that the probe is an unprivileged read, sends nothing to M2, leaves the session untouched, is lock-free, and explains how peak and swap values are obtained on Linux versus macOS.

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 front-loaded with the tool's purpose and return metrics, then uses remaining space for genuinely useful behavioral context. Platform-specific swap details and the lock-free note each earn their place by helping the agent interpret the output.

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?

An output schema exists, so the description does not need to explain return formatting, yet it still adds necessary interpretation guidance such as RSS being a high-water mark and swap differences across platforms. It is complete for a zero-parameter, read-only diagnostic tool.

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?

The tool takes zero parameters, so there are no parameter semantics to clarify in the schema. The description appropriately omits parameter discussion, though with no parameters there is nothing extra it could add.

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 names a specific verb and resource: report the persistent Macaulay2 kernel's memory. It immediately lists the five metrics returned (RSS, peak, swap, pid, uptime), making it unmistakably distinct from siblings like m2_evaluate, m2_interrupt, and m2_session_reset.

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

Usage Guidelines5/5

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

It gives explicit when-to-use guidance: call it while a long m2_evaluate runs to watch memory live. It also routes the agent toward the alternative decision point by saying this helps decide whether m2_interrupt is worthwhile.

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