Skip to main content
Glama
BrianGTRxx

api-mock-sandbox

by BrianGTRxx

Setup Mock API

setup_mock_api

Start or reconfigure a persistent local mock REST API with CORS, using a schema to seed collections so data survives refreshes and tool calls.

Instructions

Starts (or reconfigures) a local, persistent REST API that a Claude Artifact can call directly (fetch) with full CORS support, instead of losing state on every refresh. Give it a schema describing the resources you need as seed data; each key becomes a collection served at http://localhost:/api/ supporting GET/POST/PUT/PATCH/DELETE. Data is written to sandbox_db.json next to this server and survives across Artifact refreshes and tool calls: collections that already exist from a previous call are left as-is, not overwritten. Use get_mock_api_status to check whether a server is already running before calling this.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNoTCP port for the local mock API. Defaults to 3001.
schemaYesMap of resource name to an array of seed objects, e.g. {"tasks": [{"title": "Buy milk", "done": false}], "users": [{"name": "Ana"}]}. Items don't need an id field; one is generated automatically if missing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations, the description carries full behavioral burden, and it succeeds: it discloses disk persistence to sandbox_db.json, idempotent behavior for existing collections, supported HTTP methods, and CORS support. These are exactly the side effects and runtime traits an agent needs to predict tool behavior.

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?

Every sentence earns its place: purpose and motivation, resource definition, persistence semantics, and a precondition. Information is front-loaded with the verbs 'Starts (or reconfigures)' and critical behavior follows immediately. No filler or repetition.

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?

The description covers purpose, input shape, endpoint behavior, persistence, reconfiguration semantics, and the sibling tool check. Even without an output schema or annotations, an agent has enough to decide when to call it and how to construct a correct request.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the schema covers both parameters, the description adds essential meaning: schema keys become collections at /api/<key>, items get auto-generated IDs if missing, and the server exposes full CRUD. This goes beyond the schema by explaining how inputs map to runtime resources and endpoints.

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+resource: starts/reconfigures a local persistent REST API with CORS support. Clearly distinguishes itself from the sibling get_mock_api_status by naming it as the check step. The description leaves no ambiguity about what the tool accomplishes.

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?

Explicitly tells the agent to call get_mock_api_status before invoking this tool to avoid duplicate setup. It also explains the motivating scenario (state persistence across Artifact refreshes). This provides clear when-to-use guidance and names the relevant alternative.

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

Install Server

Other Tools