Skip to main content
Glama

update_mock

Update an existing mock API endpoint. Replaces all fields including rules. IMPORTANT: When updating rules, you MUST provide the full updated rules array — partial updates are not supported. Use get_mock_detail first to read the current state before modifying. This also supports adding/removing stateful simulation fields (stateLookupExpr, stateCaptureExpr, stateCaptureVariables).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectId": "<projectId>",
      "mockId": "<mockId>",
      "name": "<name>",
      "method": "<method>",
      "path": "<path>"
    },
    "name": "update_mock"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesDescriptive name of the mock endpoint
pathYesHTTP resource path, e.g. /v1/users/{id}
tagsNoTags for categorization and search
rulesNoFull replacement rules array for this mock. Rules are evaluated in ascending priority order. First match wins. Providing an empty array [] removes all rules and returns only the default response.
methodYesHTTP method (GET, POST, PUT, DELETE, PATCH, etc.)
mockIdYesDatabase ID of the mock endpoint to update
delayMsNoDefault latency delay in milliseconds
projectIdYesDatabase ID of the project
webhookUrlNoOptional outbound webhook URL to call after each request. LOCAL RELAY OPTION: If developing locally, instead of a public URL, you can use the 'simceptor://local/<path>' scheme (e.g. 'simceptor://local/api/payment/callback') to route webhook payloads through an active Local Relay WebSocket tunnel to your local server. ALWAYS call 'check_relay_status' first to verify if a relay session is active.
descriptionNoOptional description visible in the dashboard UI
soapEnabledNoSet to true to enable SOAP / WSDL mode for this mock. Auto-detected if responseHeaders contains 'xml' or responseBody starts with '<'.
wsdlContentNoOptional raw WSDL XML content definition for SOAP service discovery (?wsdl).
collectionIdNoOptional collection folder ID to move this mock to
responseBodyNoDefault response body (fallback when no rule matches). Supports all dynamic expressions: {{path.<var>}}, {{query.<param>}}, {{header.<Name>}}, {{body.<jsonPath>}}, {{form.<field>}} (with ':default' fallback), {{random.uuid}} / {{random_uuid}}, {{random.number:<len>}}, {{random.alphabet:<len>}}, {{random.alphanumeric:<len>}}, {{random.date:<format>:<offset>}}, {{faker.name_id}}, {{faker.email}}, {{faker.phone_id}}, {{faker.company}}, {{faker.city}}, {{faker.address}}, {{faker.jobtitle}}, {{faker.car}}, {{faker.price:<min>:<max>}}, {{state.<field>}}, {{env.<KEY>:<default>}}, and '__repeat' array loops. IMPORTANT: For JSON responses, enclose all {{...}} placeholders in double quotes and do NOT include raw newline characters (\n) in the JSON payload. NOTE: the tool response includes a `responseBodyWarning` field if this doesn't look like valid JSON structurally.
webhookMethodNoHTTP method for the webhook. Default: POST.
collectionNameNoOptional collection folder name to assign or move this mock to
responseStatusNoDefault HTTP status code (fallback when no rule matches)
webhookDelayMsNoMilliseconds to wait before firing the webhook.
webhookHeadersNoJSON string of headers for the webhook request.
webhookPayloadNoWebhook request body. Supports dynamic expressions.
responseHeadersNoDefault response headers as JSON string
stateLookupExprNoExpression to load session state before evaluating rules. E.g. 'request.body.user_id'
stateCaptureExprNoExpression to determine the key for saving session state after this request. E.g. 'request.body.id'
stateCaptureVariablesNoJSON object mapping variable names to expressions for saving into state. E.g. '{"balance":"request.body.amount"}'. Values not starting with request./response./body./query./header./path./state./item./random./faker. are stored as literal strings as-is.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / responseBody / description
      Previous value: -"Default response body (fallback when no rule matches). Supports dynamic expressions. IMPORTANT: For JSON responses, do NOT include raw newline characters (\\n) in the JSON payload as it will make the JSON structure malformed. NOTE: the tool response includes a `responseBodyWarning` field if this doesn't look like valid JSON structurally."New value: +"Default response body (fallback when no rule matches). Supports all dynamic expressions: {{path.<var>}}, {{query.<param>}}, {{header.<Name>}}, {{body.<jsonPath>}}, {{form.<field>}} (with ':default' fallback), {{random.uuid}} / {{random_uuid}}, {{random.number:<len>}}, {{random.alphabet:<len>}}, {{random.alphanumeric:<len>}}, {{random.date:<format>:<offset>}}, {{faker.name_id}}, {{faker.email}}, {{faker.phone_id}}, {{faker.company}}, {{faker.city}}, {{faker.address}}, {{faker.jobtitle}}, {{faker.car}}, {{faker.price:<min>:<max>}}, {{state.<field>}}, {{env.<KEY>:<default>}}, and '__repeat' array loops. IMPORTANT: For JSON responses, enclose all {{...}} placeholders in double quotes and do NOT include raw newline characters (\\n) in the JSON payload. NOTE: the tool response includes a `responseBodyWarning` field if this doesn't look like valid JSON structurally."
    • changedInput schema / properties / rules / items / properties / responseBody / description
      Previous value: -"Response body to return when this rule matches. Supports all dynamic expression placeholders (e.g. {{body.user_id}}, {{path.id}}, {{random_uuid}}). IMPORTANT: For JSON responses, do NOT include raw newline characters (\\n) in the JSON payload as it will make the JSON structure malformed."New value: +"Response body to return when this rule matches. Supports all dynamic expression placeholders:\n- Request: {{path.<var>}}, {{query.<param>}}, {{header.<Name>}}, {{body.<jsonPath>}}, {{form.<field>}} (all support ':default' fallback, e.g. {{body.amount:100000}})\n- Random & UUID: {{random.uuid}} (or {{random_uuid}}), {{random.number:<len>}}, {{random.alphabet:<len>}}, {{random.alphanumeric:<len>}}\n- Date/Time: {{random.date:<format>}} or {{random.date:<format>:<offset>}} (e.g. {{random.date:yyyy-MM-dd:+7d}}, offsets: +/-Ns, m, h, d, M, y)\n- Faker (locales: _id, _jp, _kr, _global or :ID, :JP, :KR, :GLOBAL): {{faker.name_id}}, {{faker.email}}, {{faker.phone_id}}, {{faker.company}}, {{faker.city_jp}}, {{faker.address_id}}, {{faker.jobtitle}}, {{faker.car}}, {{faker.price:<min>:<max>}}\n- State & Env: {{state.<fieldName>}}, {{env.<KEY>:<default>}}, JSON array looping with '__repeat' & {{item}}, Handlebars {{#if (eq a b)}}...{{/if}}\nIMPORTANT: For JSON responses, enclose all {{...}} placeholders in double quotes and do NOT include raw newline characters (\\n) in the JSON payload."
  2. First observed

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden, and it does the most important thing: it discloses that this is a full-replace mutation ('Replaces all fields including rules') rather than a patch, and that rules must be sent in full. It still omits whether omitted optional fields are cleared, whether the operation is idempotent, and what the response contains.

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?

Four sentences, front-loaded with the purpose and then escalating to the critical constraint and prerequisite. Every sentence carries information; there is little waste, though the final sentence about stateful fields is somewhat tangential to the core update workflow.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 24-parameter mutation tool with no annotations and no output schema, the description covers the essential behavior: full replacement, mandatory full rules array, and a read-before-write prerequisite. The main gap is not spelling out that optional fields omitted from the call may be cleared by the wholesale replacement, which is a real risk for a 24-param update.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all 24 parameters in detail, including the rules array and stateful fields. The description's notes about the full rules array and stateful simulation fields largely restate what the schema says, so it adds only marginal meaning beyond structured fields — baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource ('Update an existing mock API endpoint') and immediately discloses replacement semantics ('Replaces all fields including rules'), which distinguishes it from additive siblings like add_mock_rule and remove_mock_rule. It never names those siblings explicitly, so it stops short of full sibling differentiation.

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?

It gives a clear prerequisite workflow ('Use get_mock_detail first to read the current state before modifying') and a hard constraint ('you MUST provide the full updated rules array — partial updates are not supported'). It does not explicitly say when to prefer this over add_mock_rule/remove_mock_rule, but the replacement framing implies the choice.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources