stop_locally
Stop the local mock server currently running. Returns status and optional process ID or reason for failure.
Instructions
Stop the mockzilla server started by serve_locally. Takes no arguments — there's only ever one local server running. Returns {stopped: bool, pid?, reason?}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- lib/local.js:101-111 (handler)The `stopLocally` function that executes the tool logic. It kills the running local mockzilla server (if any) with SIGTERM, waits for it to exit, removes it from the map, and returns the result.
export async function stopLocally() { if (localServers.size === 0) { return { stopped: false, reason: "No mockzilla server is running." }; } const [pid, entry] = localServers.entries().next().value; entry.child.kill("SIGTERM"); await new Promise((resolve) => entry.child.once("exit", resolve)); localServers.delete(pid); if (entry.kind === "managed") lastManagedPort = null; return { stopped: true, pid, kind: entry.kind }; } - lib/tools.js:235-246 (schema)Tool registration with description and input schema (empty object, no arguments). Maps the tool name 'stop_locally' to the `stopLocally` handler.
stop_locally: { description: "Stop the mockzilla server started by `serve_locally`. Takes no " + "arguments — there's only ever one local server running. Returns " + "{stopped: bool, pid?, reason?}.", inputSchema: { type: "object", properties: {}, additionalProperties: false, }, handler: stopLocally, }, - lib/tools.js:8-16 (registration)Import of `stopLocally` from ./local.js and its inclusion in the LOCAL_TOOLS export object.
import { callEndpoint, clearMockEndpoints, listMockEndpoints, mockEndpoint, peekOpenapi, serveLocally, stopLocally, } from "./local.js";