Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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 };
    }
  • 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";
Behavior5/5

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

Despite no annotations, the description fully discloses behavior: stops server, takes no arguments, returns {stopped: bool, pid?, reason?}. No contradictions.

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?

Two concise sentences, each providing essential information. Action is front-loaded. No extraneous text.

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?

For a zero-parameter tool with no output schema, the description explicitly states return format and server uniqueness, making it complete for agent usage.

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?

No parameters, so baseline is 4. Description adds context that it takes no arguments and only one server exists, which is helpful beyond the empty schema.

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?

Clearly states the tool stops the mockzilla server started by serve_locally, specifying the action and resource. Distinguishes from sibling tools by explicitly mentioning the server it stops.

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?

Implies usage context: use after serve_locally when a local server is running. Notes there is only one server. Does not explicitly state when not to use, but the simplicity of the tool makes it adequate.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mockzilla/mockzilla-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server