Skip to main content
Glama

serve_locally

Start a temporary local mock server from OpenAPI specs or public URLs, combining multiple APIs into one server, no account needed. Use for local experimentation before deploying hosted mocks.

Instructions

Start ONE mockzilla portable mock server on this machine that serves any number of APIs together — no mockzilla account needed. Pass input as a single spec path / directory / public https URL, OR an array of them to combine multiple APIs into the same server (each becomes a service mounted at //...). Returns {url, port, pid, services} plus example_endpoints, callable URLs for a single spec. Use one of those rather than guessing a path: each service answers under its mount prefix, not at the spec's bare path. Pair with stop_locally(pid) to clean up. Prefer this over deploy_mock_from_* whenever the user says 'try locally', 'experiment', or 'play with' — those tools create persistent hosted bundles, this one is ephemeral. The bridge only runs ONE local server at a time on purpose: if the user wants more APIs, stop the current server and restart with all of them in input.

To test how a client handles a slow or failing API, pass latency and/or errors. These and mount/context work only when input is a single spec or single-service folder.

If the user names a well-known API (stripe, twilio, github, openai, slack, etc.) WITHOUT providing a URL, recall the public OpenAPI spec URL from your training knowledge and pass that. Do NOT pass a catalog ID or slug from list_catalog_products — that catalog is for the HOSTED deploy_mock_from_catalog flow, its ids are not URLs. Examples of public OpenAPI URLs: • Stripe: https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json • Twilio: https://raw.githubusercontent.com/twilio/twilio-oai/main/spec/json/twilio_api_v2010.json • GitHub: https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json • Petstore: https://petstore3.swagger.io/api/v3/openapi.json

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNoPort to bind on. Omit or pass 0 to let the OS pick a free port.
inputYesSpec file path(s), directory, or public OpenAPI URL(s). Pass an array to combine multiple APIs into one server.
mountNoURL path to mount the service at, e.g. "pets/v2".
errorsNoError injection by cumulative percentile, keys p1 to p100. {"p5": 500, "p10": 503} returns 500 for 5% of requests and 503 for the next 5%.
contextNoPath to a flat context YAML of replacement values for generated data.
latencyNoDelay added to every response, as a Go duration: "100ms", "1.5s".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.2.20
    • addedInput schema / properties / context
      Added value: +{
      +  "description": "Path to a flat context YAML of replacement values for generated data.",
      +  "type": "string"
      +}
    • addedInput schema / properties / errors
      Added value: +{
      +  "additionalProperties": {
      +    "maximum": 599,
      +    "minimum": 100,
      +    "type": "integer"
      +  },
      +  "description": "Error injection by cumulative percentile, keys p1 to p100. {\"p5\": 500, \"p10\": 503} returns 500 for 5% of requests and 503 for the next 5%.",
      +  "type": "object"
      +}
    • addedInput schema / properties / latency
      Added value: +{
      +  "description": "Delay added to every response, as a Go duration: \"100ms\", \"1.5s\".",
      +  "type": "string"
      +}
    • addedInput schema / properties / mount
      Added value: +{
      +  "description": "URL path to mount the service at, e.g. \"pets/v2\".",
      +  "type": "string"
      +}
  2. First observedv0.1.0

TDQS

A4.8/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 behavioral burden and does so thoroughly. It discloses ephemerality, single-server limitation, mount-prefix behavior, the fact that latency/errors/mount/context only work for single specs, and warns against passing catalog IDs. It even explains the returned fields.

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?

The description is long but densely packed with essential usage constraints, examples, and warnings. It front-loads the core purpose and then layers behavioral rules and alternatives. Slightly verbose with the URL examples, but each part earns its place for this complex tool.

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 tool's complexity, 6 parameters, no output schema, and many sibling alternatives, the description covers everything an agent needs: return shape, constraints, input types, known-API handling, single-server behavior, and cleanup. Nothing critical 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 is 3. The description adds value by clarifying that input can be a single path/URL or an array, that latency/errors/mount/context apply only to single-spec inputs, and that well-known API names should be resolved to public OpenAPI URLs before passing.

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 clearly states the tool starts one local mockzilla server serving any number of APIs together, with explicit contrast to the deploy_mock_from_* siblings. It names the resource, action, and scope precisely, leaving no ambiguity about what the tool does.

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 explicitly says to prefer this over deploy_mock_from_* for 'try locally', 'experiment', or 'play with', and explains those alternatives create persistent hosted bundles. It also instructs pairing with stop_locally(pid) and describes the one-server-at-a-time rule with restart guidance.

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