Skip to content

Tools ​

Each tool runs an admin API operation. A tool's arguments carry what its route takes, the body under a key, such as {"mock": ...} for add_mock and {"query": ...} for query_requests, and its schema names them. The server lists only the tools it can do: the last column says when a tool is there. A server without a journal has none of the request tools, and a gRPC server has no mock_schema.

Server ​

ToolRouteWhat it doesListed when
healthGET /healthTells the server's kind, such as http, and the URL it serves its mocks at.Always
resetPOST /resetRemoves the mocks the admin API added, loads the mock files again, starts every scenario over and clears the journal. Mocks added in code, and the key-value store, stay.Always

Mocks ​

ToolRouteWhat it doesListed when
list_mocksGET /mocksLists every mock, enabled or not, in the order mocks match requests, with its priority, hits and origin.Always
get_mockGET /mocks/{id}Gets a mock as a mock file describes it, which replace_mock takes back.Always
mock_schemaGET /schemaGets the JSON Schema of the server's mock files.HTTP servers
validate_mockPOST /mocks/validateChecks a mock as add_mock would, without adding it, and lists its problems.Always
add_mockPOST /mocksAdds a mock, which the server serves at once. An id in use is refused.Always
replace_mockPUT /mocks/{id}Replaces a mock in one step: a request finds the old mock or the new one, never neither.Always
update_mockPATCH /mocks/{id}Enables or disables a mock. A disabled mock matches no request, and keeps its hits.Always
remove_mockDELETE /mocks/{id}Removes a mock.Always
remove_all_mocksDELETE /mocksRemoves every mock, of mock files and code too.Always
reload_mocksPOST /mocks/reloadLoads the mock files, and the mocks the admin API keeps, again.Always
save_mocksPOST /mocks/saveWrites the mocks the admin API added as mock files, and lists their paths.Always

Recording ​

ToolRouteWhat it doesListed when
start_recordingPOST /recordingStarts a recording: requests go to its target, and their answers become mock files once it stops.Always
recording_statusGET /recordingCounts the recording's calls and the mocks it wrote, or tells that none runs.Always
stop_recordingDELETE /recordingStops the recording, and lists the mock files it wrote, which the server serves from then on.Always

See Recording.

Scenarios ​

ToolRouteWhat it doesListed when
list_scenariosGET /scenariosLists every scenario: its state, the states its mocks name, and which mock moves it where.Always
set_scenarioPUT /scenarios/{name}Moves a scenario to a state. A state none of its mocks names is refused.Always
reset_scenarioDELETE /scenarios/{name}Moves one scenario back to where it started: every instance of it, or the one of a key.Always
reset_scenariosDELETE /scenariosMoves every scenario back to where it started.Always

See Scenarios.

Key-value store ​

ToolRouteWhat it doesListed when
list_kvGET /kvLists the keys of the key-value store templates read, in order, without their values.Always
get_kvGET /kv/{key}Gets the value of a key. A key that isn't set is refused.Always
set_kvPUT /kv/{key}Sets a key to a value, which templates read from the next request on.Always
delete_kvDELETE /kv/{key}Removes a key. A key that isn't set is no error.Always
reload_kvPOST /kv/reloadLoads the store again from its file, in place of every value. A file with a problem changes nothing.The store loads from a file, as the command's kv.file does

See Key-value store.

Requests ​

ToolRouteWhat it doesListed when
list_requestsGET /requestsLists the newest requests of the journal, newest first, a page at a time.The server keeps a journal
get_requestGET /requests/{id}Gets a request, with its answer and the mock that answered it.The server keeps a journal
query_requestsQUERY /requestsFinds and counts the requests a query selects, such as those a mock's request part matches.The server keeps a journal
verify_requestsQUERY /requests/verifyChecks that the journal holds the requests a test expects: how many, by when, or in what order. A failed check says why.The server keeps a journal
clear_requestsDELETE /requestsRemoves every request of the journal.The server keeps a journal

verify_requests takes the check under check: see Verifying over MCP and the request journal.