Mock Server — MCP Tools
25 tools in the Mock Server group of the Routebase MCP server.
clear_request_logs
Delete ALL request logs of a mock server. Cannot be undone — do this before a clean test run, not while investigating. Requires project context.
Required scope: mock-server:manage
| Parameter | Type | Required | Description |
|---|---|---|---|
mockServerId |
string | Yes | The public Id (Guid) of the mock server |
create_mock_rule
Create a new mock rule that defines how the mock server responds to matching requests. At minimum, provide a name, path pattern, and response status code. The path pattern supports wildcards (e.g., '/api/users/*' or '/api/v{version}/items/**'). Requires project context (call set_context first).
Required scope: mock-server:manage
| Parameter | Type | Required | Description |
|---|---|---|---|
mockServerId |
string | Yes | The public Id (Guid) of the mock server |
name |
string | Yes | Display name for the rule |
pathPattern |
string | Yes | URL path pattern to match (supports wildcards: * for single segment, ** for multiple) |
method |
string | No | HTTP method to match: get, post, put, patch, delete, head, options (null = any method) |
responseStatusCode |
integer | No (default 200) |
HTTP status code to return (default 200) |
responseBody |
string | No | Response body content (string or JSON) |
responseContentType |
string | No (default "application/json") |
Content-Type header for response (default 'application/json') |
description |
string | No | Optional description for the rule |
queryPattern |
string | No | Query parameter matching pattern as JSON object |
headersPattern |
string | No | Header matching pattern as JSON object |
priority |
integer | No | Rule priority — lower number = higher precedence (default 100) |
responseHeaders |
string | No | Additional response headers as JSON object |
delayMilliseconds |
integer | No | Fixed delay in milliseconds before sending response |
isDynamic |
boolean | No | Enable dynamic template processing in response body (Handlebars-style) |
create_mock_server
Create a new mock server for the active project. Each project can have one mock server. Returns the created server with its unique MockCode and URL. Requires project context (call set_context first).
Required scope: mock-server:manage
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | No | Optional display name for the mock server |
delete_mock_rule
Delete a mock rule from the active project's mock server. Use 'list_mock_rules' to find the rule's public ID. Requires project context.
Required scope: mock-server:manage
| Parameter | Type | Required | Description |
|---|---|---|---|
ruleId |
string | Yes | The public ID (GUID) of the mock rule to delete |
delete_mock_server
Delete the active project's mock server and all its rules. Use 'get_mock_server' to find the mock server's public ID. Requires project context.
Required scope: mock-server:manage
| Parameter | Type | Required | Description |
|---|---|---|---|
mockServerId |
string | Yes | The public ID (GUID) of the mock server to delete |
generate_rules_from_spec
Automatically generate mock rules from an API specification. Creates one rule per endpoint with Smart Mock responses based on schemas. Optionally target a specific spec version. By default, skips endpoints that already have rules. Requires project context (call set_context first).
Required scope: mock-server:manage
| Parameter | Type | Required | Description |
|---|---|---|---|
specId |
string | Yes | The public Id (Guid) of the API specification to generate rules from |
versionId |
string | No | Optional: The public Id (Guid) of a specific spec version. If omitted, uses all endpoints. |
skipExisting |
boolean | No (default true) |
If true (default), skip endpoints that already have mock rules |
get_mock_rule_diagnostics
Inspect one mock rule. view 'drift' (default) compares the rule against the latest published spec version and lists what changed since it was pinned; view 'state' returns the stored state of a stateful rule. Requires project context.
Required scope: mock-server:read
| Parameter | Type | Required | Description |
|---|---|---|---|
ruleId |
string | Yes | The public Id (Guid) of the mock rule |
view |
string | No (default "drift") |
What to inspect: 'drift' (default) or 'state' |
get_mock_server
Get the mock server status and URL for the active project. Returns server details including MockCode, URL, active status, rule count, and Smart Mock settings. Returns null if no mock server exists yet (use create_mock_server to create one). Set includeStats to also get rule, request-log and spec-coverage statistics. The access token is never returned; when requireToken is on, the only way to obtain one is 'regenerate_mock_server_token' (which invalidates the old token). Requires project context (call set_context first).
Required scope: mock-server:read
| Parameter | Type | Required | Description |
|---|---|---|---|
includeStats |
boolean | No (default false) |
Also return rule counts, request-log aggregates and which spec endpoints have no mock rule yet. Defaults to false. |
get_mock_usage
Read the organization's mock request usage against its plan limit. view 'current' (default) returns the running month with the limit and reset date, 'history' the monthly totals, 'breakdown' the current month split by project. This is what to check when mock requests start being rejected. Requires organization context.
No special scope — available to any authenticated key.
| Parameter | Type | Required | Description |
|---|---|---|---|
view |
string | No (default "current") |
What to read: 'current' (default), 'history' or 'breakdown' |
months |
integer | No (default 6) |
For view 'history': how many months back. Defaults to 6. |
get_org_mock_defaults
Read the organization-wide mock server defaults — faker locale, time format, time zone, default mock type and whether the built-in matching rules apply. Every project inherits these unless update_mock_server overrides them. Requires organization context.
Required scope: org:manage-governance
No parameters.
get_request_logs
Get request logs from the mock server showing recent incoming requests and matched rules. Supports filtering by HTTP method, path, status code, and time range. Pass logId to get ONE log with its full request and response bodies and headers instead of the list — that is where you look when a request matched the wrong rule. Requires project context (call set_context first).
Required scope: mock-server:read
| Parameter | Type | Required | Description |
|---|---|---|---|
mockServerId |
string | Yes | The public Id (Guid) of the mock server |
method |
string | No | Filter by HTTP method (e.g., 'GET', 'POST') |
pathContains |
string | No | Filter by path containing this text |
statusCode |
integer | No | Filter by response status code |
skip |
integer | No (default 0) |
Number of logs to skip (for pagination, default 0) |
take |
integer | No (default 50) |
Number of logs to return (default 50, max 100) |
logId |
string | No | Public Id (Guid) of a single log. When given, returns that one log in full (bodies and headers) and every filter and pagination parameter is ignored. |
list_mock_rules
List all mock rules for a mock server with pagination. Returns rules sorted by priority (lower = higher precedence) with path pattern, method, status code, and active status. Requires project context (call set_context first).
Required scope: mock-server:read
| Parameter | Type | Required | Description |
|---|---|---|---|
mockServerId |
string | Yes | The public Id (Guid) of the mock server |
skip |
integer | No (default 0) |
Number of rules to skip (for pagination, default 0) |
take |
integer | No (default 50) |
Number of rules to return (default 50, max 100) |
list_org_builtin_rules
List the built-in Smart Mock matching rules with the organization's overrides applied. hasOrgOverride tells you whether a rule was explicitly turned on or off here, or is running on the shipped default. Built-in rules have no id — they are addressed by their conditionType, dataType and conditionDetails. Requires organization context.
Required scope: org:manage-governance
| Parameter | Type | Required | Description |
|---|---|---|---|
category |
string | No | Filter by category: person, location, internet, date_time, finance, identifier, media or misc |
list_org_smart_mock_rules
List the organization's custom Smart Mock matching rules. They apply to every mock server in the organization unless a project overrides them. Requires organization context.
Required scope: org:manage-governance
| Parameter | Type | Required | Description |
|---|---|---|---|
category |
string | No | Filter by category: person, location, internet, date_time, finance, identifier, media or misc |
skip |
integer | No (default 0) |
Number of rules to skip (for pagination, default 0) |
take |
integer | No (default 50) |
Number of rules to return (default 50, max 100) |
list_smart_mock_matching_rules
List the Smart Mock matching rules of one mock server — the rules that decide which faker value a field name gets. Includes the built-in catalog unless you filter it out. Requires project context.
Required scope: mock-server:read
| Parameter | Type | Required | Description |
|---|---|---|---|
mockServerId |
string | Yes | The public Id (Guid) of the mock server |
isBuiltIn |
boolean | No | true for built-in rules only, false for custom rules only. Omit for both. |
category |
string | No | Filter by category: person, location, internet, date_time, finance, identifier, media or misc |
skip |
integer | No (default 0) |
Number of rules to skip (for pagination, default 0) |
take |
integer | No (default 50) |
Number of rules to return (default 50, max 100) |
manage_mock_rule_ops
Maintenance operations on existing mock rules. action: 'reorder' (rulePublicIds in the new priority order, needs mockServerId), 'regenerate' (re-generate one rule's response body from the spec, needs ruleId; set previewOnly to compare old and new without saving), 'reset_state' (clear a stateful rule's stored state, needs ruleId), 'sync_from_spec' (re-pin one rule to the latest published spec version, needs ruleId), 'bulk_delete' (needs mockServerId and rulePublicIds), 'bulk_regenerate' (re-generate every regenerable rule of the project). Requires project context.
Required scope: mock-server:manage
| Parameter | Type | Required | Description |
|---|---|---|---|
action |
string | Yes | What to do: 'reorder', 'regenerate', 'reset_state', 'sync_from_spec', 'bulk_delete' or 'bulk_regenerate' |
ruleId |
string | No | Public Id (Guid) of a single mock rule. Required for 'regenerate', 'reset_state' and 'sync_from_spec'. |
mockServerId |
string | No | Public Id (Guid) of the mock server. Required for 'reorder' and 'bulk_delete'. |
rulePublicIds |
string | No | Comma-separated mock rule Ids. Required for 'reorder' (in the desired order) and 'bulk_delete'. |
previewOnly |
boolean | No (default false) |
For 'regenerate': return the old and new body without saving. Defaults to false. |
manage_org_builtin_rules
Enable or disable built-in Smart Mock matching rules for the whole organization. action: 'toggle' for one rule (needs conditionType, dataType, conditionDetails and isEnabled), 'bulk_toggle' for several (needs rulesJson) — use bulk_toggle to switch a whole category at once. Take the addressing fields from list_org_builtin_rules; built-in rules have no id. Requires the org:manage-governance permission.
Required scope: org:manage-governance
| Parameter | Type | Required | Description |
|---|---|---|---|
action |
string | Yes | What to do: 'toggle' or 'bulk_toggle' |
conditionType |
string | No | How the rule matches: 'exact', 'wildcard' or 'regex'. Required for 'toggle'. |
dataType |
string | No | The rule's data type: 'any', 'string', 'integer', 'number' or 'boolean'. Required for 'toggle'. |
conditionDetails |
string | No | The rule's field-name pattern. Required for 'toggle'. |
isEnabled |
boolean | No | Whether the rule applies. Required for 'toggle'. |
rulesJson |
string | No | JSON array for 'bulk_toggle'. Each item: { "conditionType": string, "dataType": string, "conditionDetails": string, "isEnabled": bool }. |
manage_org_smart_mock_rule
Create, update, delete or enable/disable an organization-wide custom Smart Mock matching rule. action: 'create' (needs conditionDetails, fakerType and category), 'update' (needs ruleId; omitted fields keep their value), 'delete' (needs ruleId), 'toggle' (needs ruleId and isEnabled). Requires the org:manage-governance permission.
Required scope: org:manage-governance
| Parameter | Type | Required | Description |
|---|---|---|---|
action |
string | Yes | What to do: 'create', 'update', 'delete' or 'toggle' |
ruleId |
string | No | Public Id (Guid) of the rule. Required for 'update', 'delete' and 'toggle'. |
conditionDetails |
string | No | The field-name pattern to match, e.g. 'email' or '*_at'. Required for 'create'. |
conditionType |
string | No | How to match: 'exact', 'wildcard' or 'regex'. Defaults to 'exact' on create. |
dataType |
string | No | Restrict to a JSON type: 'any' (default), 'string', 'integer', 'number' or 'boolean' |
fakerType |
string | No | The faker type to generate, e.g. 'internet.email'. Required for 'create'. |
category |
string | No | Category: person, location, internet, date_time, finance, identifier, media or misc. Required for 'create'. |
caseSensitive |
boolean | No | Match the field name case-sensitively. Defaults to false on create. |
remark |
string | No | Free-text note explaining the rule |
sortOrder |
integer | No | Position in the matching order — lower wins. Defaults to 0 on create. |
isEnabled |
boolean | No | Whether the rule applies. Required for 'toggle'. |
manage_smart_mock_matching_rule
Create, update, delete or enable/disable a custom Smart Mock matching rule on ONE mock server. Built-in rules cannot be edited here — toggle them organization-wide with manage_org_builtin_rules. action: 'create' (needs mockServerId, conditionDetails, fakerType and category), 'update' (needs ruleId; omitted fields keep their value), 'delete' (needs ruleId), 'toggle' (needs ruleId and isEnabled). Requires project context.
Required scope: mock-server:manage
| Parameter | Type | Required | Description |
|---|---|---|---|
action |
string | Yes | What to do: 'create', 'update', 'delete' or 'toggle' |
mockServerId |
string | No | Public Id (Guid) of the mock server. Required for 'create' and for reading the current state on 'update'. |
ruleId |
string | No | Public Id (Guid) of the matching rule. Required for 'update', 'delete' and 'toggle'. |
conditionDetails |
string | No | The field-name pattern to match, e.g. 'email' or '*_at'. Required for 'create'. |
conditionType |
string | No | How to match: 'exact', 'wildcard' or 'regex'. Defaults to 'exact' on create. |
dataType |
string | No | Restrict to a JSON type: 'any' (default), 'string', 'integer', 'number' or 'boolean' |
fakerType |
string | No | The faker type to generate, e.g. 'internet.email'. Required for 'create'. |
category |
string | No | Category: person, location, internet, date_time, finance, identifier, media or misc. Required for 'create'. |
caseSensitive |
boolean | No | Match the field name case-sensitively. Defaults to false on create. |
remark |
string | No | Free-text note explaining the rule |
sortOrder |
integer | No | Position in the matching order — lower wins. Defaults to 0 on create. |
isEnabled |
boolean | No | Whether the rule applies. Required for 'toggle'. |
preview_smart_mock
Render a response body template with its {{faker.*}} placeholders replaced by generated values, using the active project's Smart Mock settings. Use this to check a template before saving it on a rule. Requires project context.
Required scope: mock-server:read
| Parameter | Type | Required | Description |
|---|---|---|---|
responseBody |
string | Yes | The response body template containing {{faker.*}} placeholders |
regenerate_mock_server_token
Issue a new access token for the mock server of the active project and return it. The old token stops working immediately — every client that sends it starts failing. Only relevant while requireToken is on. Requires project context.
Required scope: mock-server:manage
No parameters.
test_smart_mock
Test Smart Mock matching for a given field name. Returns which matching rule would apply and what value it would generate. Useful for verifying Smart Mock configuration before generating rules. Requires project context (call set_context first).
Required scope: mock-server:read
| Parameter | Type | Required | Description |
|---|---|---|---|
mockServerId |
string | Yes | The public Id (Guid) of the mock server |
fieldName |
string | Yes | The field name to test matching for (e.g., 'email', 'firstName', 'createdAt') |
schemaType |
string | No | Optional JSON Schema type hint (e.g., 'string', 'integer', 'number', 'boolean') |
schemaFormat |
string | No | Optional JSON Schema format hint (e.g., 'date-time', 'email', 'uri', 'uuid') |
update_mock_rule
Update an existing mock rule. All fields are required — pass the current values for fields you don't want to change. Use 'list_mock_rules' or 'get_mock_server' to get current rule details first. Requires project context (call set_context first).
Required scope: mock-server:manage
| Parameter | Type | Required | Description |
|---|---|---|---|
ruleId |
string | Yes | The public Id (Guid) of the mock rule to update |
name |
string | Yes | Display name for the rule |
pathPattern |
string | Yes | URL path pattern to match |
priority |
integer | Yes | Rule priority (lower = higher precedence) |
isActive |
boolean | Yes | Whether the rule is active |
responseStatusCode |
integer | Yes | HTTP status code to return |
responseContentType |
string | No (default "application/json") |
Content-Type header for response |
method |
string | No | HTTP method to match: get, post, put, patch, delete, head, options (null = any) |
description |
string | No | Optional description |
queryPattern |
string | No | Query parameter matching pattern as JSON |
headersPattern |
string | No | Header matching pattern as JSON |
responseHeaders |
string | No | Additional response headers as JSON |
responseBody |
string | No | Response body content |
delayMilliseconds |
integer | No | Fixed delay in milliseconds before response |
isDynamic |
boolean | No (default false) |
Enable dynamic template processing |
update_mock_server
Update the mock server of the active project: name, active flag, proxy mode, CORS and the Smart Mock defaults. Omit a field to keep its current value — the tool reads the server first. Use the reset* flags to drop a per-project override so the setting follows the organization default again; omitting a value can only keep it, never inherit it. Requires project context.
Required scope: mock-server:manage
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | No | New display name for the mock server |
isActive |
boolean | No | Whether the mock server answers requests at all |
proxyTargetUrl |
string | No | Forward unmatched requests to this URL instead of returning 404 |
proxyModeEnabled |
boolean | No | Enable proxy mode for unmatched requests |
corsEnabled |
boolean | No | Send CORS headers on mock responses |
allowedOrigins |
string | No | Comma-separated allowed origins for CORS. Empty string allows all. |
fakerLocale |
string | No | Faker locale for generated values, e.g. 'en', 'de' |
defaultTimeFormat |
string | No | Default format for generated timestamps, e.g. 'iso8601' |
defaultTimeZone |
string | No | Default time zone for generated timestamps, e.g. 'UTC' |
defaultMockType |
string | No | Default mock type for generated responses |
builtInMatchingEnabled |
boolean | No | Apply the built-in Smart Mock matching rules on this server |
requireToken |
boolean | No | Require the access token on every mock request |
resetToOrgDefault |
string | No | Comma-separated settings to reset to the organization default: 'faker_locale', 'time_format', 'time_zone', 'mock_type', 'built_in_matching' |
rowVersion |
string | No | Base64 rowVersion from get_mock_server, for optimistic concurrency |
update_org_mock_defaults
Update the organization-wide mock server defaults. Omitted fields keep their current value — the command treats null as 'leave alone', so no read is needed first. Requires the org:manage-governance permission.
Required scope: org:manage-governance
| Parameter | Type | Required | Description |
|---|---|---|---|
fakerLocale |
string | No | Faker locale for generated values, e.g. 'en', 'de' |
defaultTimeFormat |
string | No | Default format for generated timestamps, e.g. 'iso8601' |
defaultTimeZone |
string | No | Default time zone for generated timestamps, e.g. 'UTC' |
defaultMockType |
string | No | Default mock type for generated responses |
builtInMatchingEnabled |
boolean | No | Apply the built-in Smart Mock matching rules organization-wide |
rowVersion |
string | No | Base64 rowVersion from get_org_mock_defaults, for optimistic concurrency |