Skip to content
Judgment Labs
Esc
↑↓navigate↵open⌘Jpreview
On this page

MCP tools

Reference for every currently registered Judgment data MCP tool, category, access level, and input field.

The Judgment data MCP groups its tools by product area. The schema returned by your client’s tools/list call is authoritative for the tools and fields available to that connection.

Scope and access

SQL and schema discovery are available without a separate rollout opt-in. Tool availability still depends on the connection’s organization, project, role, and feature permissions.

  • An unbound API-key connection supplies organization_id to every organization- or project-scoped tool and project_id to every project-scoped tool. API-key connections with an X-Organization-Id header can omit organization_id.
  • OAuth authorization binds the connection to an organization and optionally a project. The MCP server removes bound scope fields from the model-facing schema and injects them server-side. Project-bound connections also hide account- or organization-level tools that fall outside the selected project.
  • discover_schema requires organization scope and at least the viewer role, but returns no project data. Call it with {} on an organization-bound connection or with organization_id on an unbound connection.
  • Read tools inspect state. Write · developer and Write · admin require at least that organization role. A plain Write tool has more specific authorization in its description or the underlying resource.
  • The Inputs column lists the registered field names beyond the common scope fields. Use tools/list for which fields are required and their exact nested schemas.

SQL and schema discovery

Use SQL to query your project’s traces, spans, scores, datasets, and test results through a virtual schema that abstracts the underlying storage. The server validates incoming queries, permits only read-only access, and enforces organization and project scope. MCP is the recommended access path for agents. For scripts and applications, see programmatic SQL access.

Tool Access Inputs Purpose
discover_schema Read · viewer — Return the SQL schema as Markdown: tables, columns and types, row meanings, examples, and query limits. Requires organization scope.
sql_query Read · viewer sql Run one read-only SELECT using SQL to query your project’s data. Requires project scope.

Query workflow

  1. Call discover_schema to get the current schema. Use {} on an organization-bound connection or { "organization_id": "YOUR_ORGANIZATION_ID" } on an unbound connection. Use the table and column names returned by this tool.
  2. Call sql_query with a sql string and any scope arguments your connection requests. Use list_organizations and list_projects to find IDs when those tools are available on your connection.
  3. Read the returned rows. The response also contains catalog_version, columns (each with name, type, and nullable), row_count, and elapsed_ms.

For example, these sql_query arguments find the 20 slowest traces from the last day on an API-key connection without bound organization or project scope:

{
  "organization_id": "YOUR_ORGANIZATION_ID",
  "project_id": "YOUR_PROJECT_ID",
  "sql": "SELECT trace_id, trace_name, started_at, duration_ms FROM telemetry.traces WHERE started_at >= now() - INTERVAL 1 DAY ORDER BY duration_ms DESC, trace_id LIMIT 20"
}

For organization-scoped OAuth, omit organization_id; for project-scoped OAuth, omit both scope arguments. Follow the input schema advertised by your connection.

To inspect a trace’s span payloads, use a focused query such as:

SELECT span_id, parent_span_id, span_name, input, output, attributes
FROM telemetry.spans
WHERE trace_id = 'YOUR_TRACE_ID'
ORDER BY started_at, span_id
LIMIT 20

Query limits and data semantics

  • Submit one read-only SELECT, at most 50,000 characters. Queries are scoped to your authorized project.
  • Results are limited to 1,000 rows and 5 MiB. Select the columns you need, filter by time or IDs, and use a small LIMIT when exploring.
  • Large fields such as input, output, attributes, and JSON payloads have no additional SQL restrictions. Prefer narrow scopes and small payload reads. The default query memory limit is 750 MiB, configurable per deployment. A small LIMIT does not bound scan, grouping, sort, or join memory. On QUERY_MEMORY_LIMIT, narrow the scope or simplify the query before retrying.
  • Query telemetry.traces for root executions and telemetry.spans for operations, cost, and token usage. Sum span usage before joining tags or scores to avoid counting it multiple times.
  • Sessions are derived by grouping traces by session_id; there is no telemetry.sessions table. Session elapsed time runs from the earliest root start to the latest root end, including gaps and overlaps. Follow the schema’s session guidance for time filters, usage, and behavior results.
  • Query telemetry.scores for evaluation results and filter evaluation_scope when selecting span, trace, or session scores. Use get_behavior_detail for eligible-population behavior rates; sampled score fractions are not equivalent.
  • Test execution traces use telemetry.traces and telemetry.spans. The legacy evaluations.items.offline_trace_id column identifies an execution trace in these shared tables.

Migrating from retired read tools

The following tool names are no longer callable. Replace them with discover_schema followed by sql_query:

Retired tools SQL replacement
search_traces, get_trace_detail Filter and select from telemetry.traces; aggregate span usage from telemetry.spans when needed.
get_trace_spans, get_trace_span, read_span_attribute Select span metadata or payload fields from telemetry.spans. Keep payload reads narrowly scoped.
get_trace_tags Query telemetry.trace_tags by trace_id.
get_trace_behaviors Query telemetry.scores and follow the schema’s latest-result and behavior guidance.
search_sessions, get_session_detail, get_session_trace_ids Group or filter telemetry.traces by session_id; aggregate cost and tokens from telemetry.spans.
get_session_behaviors, get_session_trace_behaviors Query session or trace evaluations in telemetry.scores, using the appropriate evaluation_scope.
get_test_run_graph Aggregate evaluations.items by judge, version, and score value.

If your client still advertises retired names, refresh its tool list or reconnect. The available tools below include the retained behavior-detail, Trace Health, automation, mapper, dataset, and memory tools.

Organizations

Tool Access Inputs Purpose
list_organizations Read limit, offset List organizations available to the authenticated user. An OAuth-scoped connection returns its selected organization.

Projects

These tools are organization-scoped.

Tool Access Inputs Purpose
list_projects Read — List projects with dataset, test-run, trace, and behavior summary counts.
create_project Write · developer name Create a project.

Traces

Tool Access Inputs Purpose
get_trace_health_summary Read start_time, end_time Read project Trace Health status and failure rates for a window of at most 31 days.
get_trace_health Read trace_id Read every registered Trace Health check for one trace.
list_trace_health_failures Read check_id, start_time, end_time, limit, cursor_trace_started_at, cursor_trace_id Page through traces failing one health check.
evaluate_traces Write · developer trace_ids, judge_names Evaluate up to 100 named traces, optionally with selected judges.
evaluate_all_traces Write · developer judge_names, limit Evaluate the most recent traces across all time, up to 1,000.

Behaviors

Tool Access Inputs Purpose
get_behavior_detail Read behavior_id, start_date, end_date Read one behavior, its judge configuration, and optional date-bounded statistics.
update_behavior Write · developer behavior_id, description Update a behavior description.

Judges

Tool Access Inputs Purpose
list_judges Read version List judges and their selected configuration. Defaults to the latest version; select production for production configurations and enabled behavior outputs.
get_judge Read judge_id, version Read one selected judge version, including its definition, outputs, version metadata, and online-evaluation settings. Custom-judge source bundles are omitted.
create_judge Write · developer judge Create a prompt or custom-code judge and its initial production version. Custom-code creation accepts a base64-encoded tar.gz bundle up to 1 MiB decoded. The judge type cannot change after creation.
update_judge Write · developer judge_id, update Update a judge description and/or create one complete immutable version. New versions specify the target version, existing judge and score types, complete implementation config, outputs, and monitoring-settings snapshot. Set promoteToProduction to promote the version.
delete_judge Write · developer judge_id Delete one judge and its attached behaviors.

Datasets

Tool Access Inputs Purpose
list_datasets Read — List current datasets with versions and item counts.
get_dataset Read dataset_id, name, version, limit, cursor_created_at, cursor_example_id Read current dataset metadata and one keyset-paginated item page.
create_dataset Write · developer name, schema, examples Create a dataset with a required JSON Schema and optional initial examples.
add_examples_to_dataset Write · developer dataset_id, examples Add examples matching the dataset schema and create a version. Trace/session-typed columns take stored trace/session IDs in each example’s data.
remove_examples_from_dataset Write · developer dataset_id, example_ids Remove examples and create a version.
delete_dataset Write · admin dataset_id Delete a dataset, its versions and memberships, and associated test configurations and test-run metadata. Underlying example records and ClickHouse evaluation results are retained.

Tests

The offline-test interface has nine tools. Use list_test_runs to find runs, get_test_run for one run’s metadata and status, and get_test_run_items for paginated per-example results. Aggregate score charts remain available on the test run page; use sql_query against evaluations.items for custom score distributions and aggregates. Keep judge versions separate when comparing results.

Tool Access Inputs Purpose
list_test_configs Read dataset_id List current test configurations, optionally for one dataset.
create_test_config Write · developer name, description, dataset_id, judge_ids Create a reusable test configuration.
update_test_config Write · developer test_config_id, name, description Update a test configuration’s name or description.
delete_test_config Write · admin test_config_id Delete a test configuration.
list_test_runs Read test_config_id, dataset_id, status, limit List current test runs and pinned dataset versions.
get_test_run Read test_run_id Read one test run.
get_test_run_items Read test_run_id, limit, cursor Read per-example results, including partial results while work is running; page size is at most 200.
run_test Write · developer test_config_id, dataset_version_number, judge_versions Queue a test from a saved configuration.
cancel_test_run Write · developer test_run_id Cancel a pending or running test.

Automations

Tool Access Inputs Purpose
list_automations Read — List conditions, actions, and active state.
get_automation Read rule_id Read one automation.
create_automation Write · developer name, description, conditions, combine_type, actions, cooldown_period, trigger_frequency Create an automation.
update_automation Write · developer rule_id, name, description, conditions, combine_type, actions, active, cooldown_period, trigger_frequency Update or enable/disable an automation.
delete_automation Write · admin rule_id Delete an automation.

Production issues

Tool Access Inputs Purpose
list_issues Read user_status, production_activity, priority List production issues with optional status, activity, and priority filters.
get_issue Read issue_id Read one issue, evidence, and event history.
create_issue Write · developer title, diagnosis, cited_items; optional issue_key and issue fields Create one evidence-backed issue; duplicate keys conflict.
update_issue Write · developer issue_id; optional issue fields, cited_items, user_status, message, judge_id, behavior_id Edit one issue, refresh evidence, comment, ignore, reopen, or transfer to Judge monitoring.
  • Existing root cause: pass its issue_id and fresh cited_items to update_issue. Citations accumulate; inactive issues resurface, and ignored, monitored, or merged issues reject new evidence.
  • Monitoring: select or create a Judge with continuous online evaluation above 0% sampling, then call update_issue with user_status=monitored, judge_id, and the exact behavior_id from its production version. If the transfer fails, retry with the same IDs.
  • Conflicts: updates are atomic. On a conflict, reread get_issue before retrying; after an uncertain response, check the timeline before resending a message.

create_issue returns { issue: { id, issue_key } }; a duplicate issue_key conflicts. update_issue returns { issue }; read events through get_issue.

Attribute mappers

Attribute mappers copy incoming span attributes to public Judgment attribute keys during ingestion.

Tool Access Inputs Purpose
list_mappers Read — List project and applicable organization-wide mappers.
get_mapper Read config_id Read one mapper.
create_mapper Write · developer name, rules, enabled, override, remove_source Create a project mapper. Organization-wide creation is admin-only.
update_mapper Write · developer config_id, name, rules, enabled, override, remove_source Update mapper rules or flags.
delete_mapper Write · developer config_id Delete a mapper.

Agent memory

These tools operate on shared project memory.

Tool Access Inputs Purpose
list_memory_entries Read — List project memory folders and files.
search_memory_files Read query, limit Search memory paths and bodies for concise references.
read_memory_files Read ids, names Fetch full files by ID or path, up to 200 total.
write_memory_file Write · developer name, body Create or update a durable project memory file.

The old names are no longer available. Update list_agent_memory_entries to list_memory_entries, fetch_agent_memory_files to read_memory_files, search_agent_memory_files to search_memory_files, and write_memory to write_memory_file. Inputs, outputs, and stored memory are unchanged.

Documentation bridge

These two read-only tools are registered on the authenticated data MCP for convenience, so coding agents can consult current product guidance without a second integration. Both proxy the docs site’s own hosted MCP server at docs.judgmentlabs.ai/mcp (its search_docs and get_page tools), so their inputs and results match that server exactly.

Tool Access Inputs Purpose
search_docs Read query, contentTypes, filters, limit Full-text search over Judgment documentation; returns each hit’s title, route, content type, and excerpt.
read_doc_page Read route Read one documentation page as agent-optimized Markdown.

Verify the live schema

If a field or tool differs from this page, inspect the tool list exposed to the current connection. Available tools can vary by authorization scope and account configuration. Reconnect after an authorization-scope change so the client refreshes tools/list.

Was this page helpful?