Skip to content
shimmer/docs
Get started

For your agent

Connect your coding agent through the CLI or MCP to inspect traces, manage assertions, and build test suites.

On this page

Give your coding agent access to Shimmer so it can inspect traces, define assertions, and build regression suites. Use the CLI from a terminal or connect through MCP. Both operate in the org you authorize.

Connect with the CLI

Install the Python package in your project's environment, then sign in and select an org:

terminal
pip install shimmer-sdk
shimmer auth login

Python 3.11 or newer is required. To select an org by name, use shimmer auth login --org NAME. If a browser cannot open in the terminal's environment, use --no-browser and follow the printed login URL. shimmer auth logout removes the local session.

Commands that return data print JSON to standard output. Use --help to discover arguments and --schema on supported commands to inspect request and response JSON Schemas without making a request:

terminal
shimmer traces create --schema
shimmer traces get --schema
shimmer traces update --schema
shimmer traces list --schema
shimmer traces assertions add --schema
shimmer traces assertions list --schema
shimmer suites create --schema
shimmer suites list --schema

Connect with MCP

Add a remote HTTP MCP server in your agent's MCP settings with this URL:

text
https://getshimmer.dev/api/mcp

Authorize the connection in your browser and select an org. The client must support remote HTTP MCP and OAuth authorization. The MCP connection has its own authorization; signing in through the CLI does not authorize MCP.

Use your client's tool discovery to inspect the available tools and their input schemas. Shimmer's tools return structured data for reads and creation, and a text confirmation for deletion.

Read a trace

Use a full Shimmer trace UUID:

terminal
shimmer traces get TRACE_ID

The response contains the trace's metadata, suite memberships, and normalized events in conversation order. The MCP equivalent is get_trace with trace_id.

List and rename traces

terminal
shimmer traces list
shimmer traces update TRACE_ID --name 'Refund lookup'

Listing returns the org's traces in a traces array, each with its metadata and suite memberships but without events. Updating sets the trace's display name and returns its metadata; pass --name '' to clear the name so the trace shows its first user message.

The MCP equivalents are list_traces, which takes no arguments, and update_trace, taking trace_id and name.

Create a trace

Save a recorded interaction as trace.json, using native Shimmer events or a LangSmith export:

terminal
shimmer traces create trace.json --source shimmer
shimmer traces create langsmith-export.json --source langsmith

Use - instead of a filename to read JSON from stdin. The optional --name sets a display name. Each invocation returns a new traceId; uploading the same interaction again creates another trace.

The MCP equivalent is create_trace. Pass source (shimmer or langsmith), the recorded JSON object as payload, and optionally name. The tool's input schema describes the native event format:

json
{
  "source": "shimmer",
  "payload": {
    "events": [
      { "kind": "user", "content": "Track my order" },
      { "kind": "assistant", "content": "What is your order number?" }
    ]
  }
}

Creating a trace records an interaction. Add it to a suite separately to use it as a test case.

Freeze a trace's clock

Agents that read the date behave differently on every run. Set a freeze time on the trace so its test case runs start their clock at that time:

terminal
shimmer traces update TRACE_ID --freeze-time 2026-01-05T09:00:00-08:00
shimmer traces update TRACE_ID --clear-freeze-time

Use an ISO 8601 time with an offset. The clock keeps ticking from the freeze time, so timeouts and sleeps still work. Each run keeps the freeze time it started with, so editing the trace doesn't change past runs. --name renames the trace in the same command.

The MCP equivalent is update_trace with trace_id and freeze_time; an empty freeze_time clears it. get_trace and case runs return freezeTime.

Shimmer freezes the clock in the Python process that runs your ShimmerTest. If your agent runs in another process, read the time with shimmer.get_freeze_time() inside the test and pass it to the agent.

Inspect and add assertions

Read existing assertions before adding more:

terminal
shimmer traces assertions list TRACE_ID
shimmer traces assertions add TRACE_ID \
  --statement 'The agent asks for the order number.'
shimmer traces assertions add TRACE_ID \
  --statement 'The agent does not invent an order status.'

The list command prints a JSON array, or [] when no assertions are configured. The MCP equivalent, list_assertions, accepts trace_id and returns an object with an assertions array.

Use MCP create_assertion with trace_id and statement to add an assertion. Each call creates a new assertion. Every assertion states behavior that must hold; phrase prohibited behavior as a negative statement, such as "The agent does not invent an order status." Assertions apply to future evaluations using the baseline trace across its suites; existing runs are not re-evaluated.

To remove an assertion, pass its trace ID and the assertion's id from the list:

terminal
shimmer traces assertions delete TRACE_ID ASSERTION_ID

The MCP equivalent is delete_assertion, taking trace_id and assertion_id. Future evaluations stop checking the assertion; existing runs keep their results.

See Assertions for examples of observable conditions.

Create suites and add cases

terminal
shimmer suites list
shimmer suites list --name refunds
shimmer suites create refunds
shimmer suites cases add SUITE_ID --trace-id TRACE_ID
shimmer suites cases delete TEST_CASE_ID

Use a unique suite name. Listing suites returns their full IDs and names; --name filters by exact name. Suite creation returns the new suite's id and name. Use full UUIDs for SUITE_ID and TRACE_ID when adding a case. Adding a case returns the test case's id, suite, and golden traceId. Deleting a case removes it from future suite runs; its trace, assertions, and past runs are kept.

The MCP equivalents are:

  • list_suites: optionally pass name to filter by exact name.
  • create_suite: pass a unique name; the response contains id and name.
  • create_test_case: pass suite_id and trace_id to add an existing trace to a suite; the response is the test case.
  • delete_test_case: pass test_case_id to remove a case from its suite.

If adding a case fails, retry that operation using the saved trace ID rather than creating another trace.

Delete a trace

terminal
shimmer traces delete TRACE_ID

The MCP equivalent is delete_trace with trace_id. Deletion removes the trace from the org. Keep baselines you still need: deleting a source trace can make historical comparisons that reference it unavailable.

Run a suite locally

Suite execution uses the CLI and an importable Python harness in your project's environment:

terminal
LANGSMITH_TRACING=local shimmer suites run refunds --path harness

Use a module that defines a ShimmerTest class for each suite, and optionally the exact suite name to run. The runner executes your agent locally, collects its trace, and sends results to Shimmer for evaluation. The hosted MCP server does not execute local harness modules.

See Write a Python harness for setup and CLI and configuration for environment variables and exit behavior.

List suite runs

terminal
shimmer suites runs list
shimmer suites runs get SUITE_RUN_ID

Listing returns the org's suite runs, newest first, in a runs array. Each run has its id, suite (testSuiteId, testSuiteName), status, verdict, case counts by run status, evaluationCounts by outcome, startedAt, and finishedAt (null while the run is still going). Getting a run returns one of these objects.

The MCP equivalents are list_suite_runs, which takes no arguments, and get_suite_run, taking suite_run_id. They return the same JSON.

Inspect case runs

terminal
shimmer suites runs cases list <suite-run-id>
shimmer suites runs cases get <case-run-id>

Listing returns a suite run's case runs in a runs array. Each has its id, input, name, status, error, the golden (sourceTraceId) and result (resultTraceId) traces, and an evaluation with its status and assertion counts.

Getting a case run adds each assertion's result (evaluation.assertions, with its status, match, confidence, and reason), the testCase as it is now, and traceDiff: the result trace's events aligned against the golden trace's, each with a status (unchanged, modified, inserted, or deleted), the old and new events, line hunks, and a mock on tool calls whose result Shimmer replaced with the golden's.

The MCP equivalents are list_case_runs (taking suite_run_id) and get_case_run (taking case_run_id). They return the same JSON.

Replace a test case's golden trace

Record the agent's intended behavior in a new trace and upload it with shimmer traces create. Then replace the case's golden trace:

terminal
shimmer suites cases update TEST_CASE_ID --trace-id TRACE_ID

Use the test case ID, returned when the case is added and available as testCase.id in the case run details. The case keeps its ID, name, and assertions. Past runs still compare against their original golden trace. Run the suite again to verify the new baseline.

The MCP equivalent is update_test_case, taking test_case_id and trace_id.