Beyond-Bot.ai + Braintrust MCP
Query Braintrust logs with SQL, run evals and evaluators, manage prompts, datasets, dashboards, alerts and Topics automations through Braintrust's hosted MCP server.
What You Can Do with this Integration
Automate Data Entry
Automatically sync new contacts or deals from Beyond-Bot.ai to Braintrust MCP.
Enrich Customer Profiles
Use Beyond-Bot.ai to find and add new information to your records in Braintrust MCP.
Trigger Workflows
Start automated workflows in Braintrust MCP based on conversations with your virtual expert.
Available Actions
Here are the specific actions your virtual expert can perform within Braintrust MCP.
Add To Dataset
Add up to 1000 project log rows to a Braintrust dataset by row ID, like the UI's "Add to dataset", without reading and re-sending their contents. Find candidate rows with sql_query against project_logs, then pass their `id` values. Each copied row keeps the log's input, metadata, and tags, takes its expected value from the log's expected (or output), and links back to the source log via origin. Target an existing dataset by ID or name. Set create_if_missing only when a new named dataset should be created.
Add To Human Review Queue
Add existing project log traces, experiment traces, or dataset rows to Human Review, optionally assigning individual reviewers. Omit experiment_id and dataset_id to target project logs, or provide exactly one to select another source in the project. Marks selected rows PENDING; rejects the entire batch if any row is already COMPLETE, since prior scores cannot represent a new review attempt. Use log_row_ids from sql_query and resolve reviewers with lookup_users. Omit assignee_user_ids to preserve existing reviewers, or pass an empty array to flag without assignment. In Loop automations, enable this write tool explicitly in the automation's tool permissions.
Create Dashboard Sql
Create a project-scoped dashboard, optionally containing SQL charts that were already previewed with generate_dashboard_chart_sql. A dashboard is what list_monitoring_views and get_monitoring_view call a Monitoring view. Only call this when the user explicitly asks to create or save a dashboard. Pass each returned chartConfig unchanged in the charts array, using a one-element array for a single chart. Pass the preview timeFrame separately as the optional dashboard-level timeFrame; relative presets such as "3d" remain live. Omit timeFrame to use the dashboard default.
Create Environment Update Alert
Create an alert for environment updates. Use config.environment_filter to limit notifications to specific environment slugs, or omit it to match all environments.
Create Evaluator
Create a versioned Braintrust LLM or inline code evaluator. Set output_type to score for numeric scores or classification for categorical labels. For an LLM score evaluator, provide choice_scores. For an LLM classification evaluator, provide choices without numeric mappings. By default, the tool fails if the slug already exists; set if_exists to replace to create a new version, or ignore to leave the existing evaluator unchanged.
Create Facet
Create a versioned Braintrust facet that extracts structured information from spans or traces. Before using this tool, load and follow "braintrust/topics-workflow" with load_braintrust_skill. Topics and topic-classification requests use that workflow. This is a deployment/promotion tool, not a prompt-testing tool. Develop with inline test_facet_on_trace calls and run_eval experiments first; do not create a facet merely to test a candidate. Facet extraction always uses Braintrust's built-in facet model; callers do not select a model. The project default preprocessor is used when none is provided. By default, the tool fails if the slug already exists; set if_exists to replace to create a new version, or ignore to leave the existing facet unchanged.
Create Human Review Score
Create a native Human Review score definition for a project: categorical choices, a numeric slider, or a free-form text field such as Review notes. Call once per score. Fails if the name already exists.
Create Log Alert
Create an alert for individual matching project logs. config.btql_filter is a boolean expression, not a SELECT query, and config.interval_seconds throttles repeated notifications without aggregating logs.
Create Preprocessor
Create a versioned Braintrust preprocessor from inline JavaScript using the same QuickJS runtime as the Braintrust UI. When the preprocessor is for Topics or a facet, first load and follow "braintrust/topics-workflow" with load_braintrust_skill. By default, the tool fails if the slug already exists; set if_exists to replace to create a new version, or ignore to leave the existing preprocessor unchanged.
Create Prompt
Create a versioned Braintrust prompt using the same function representation as project.prompts.create() and bt functions push. Provide either a completion-style prompt or chat messages. By default, the tool fails if the slug already exists; set if_exists to replace to create a new version, or ignore to leave the existing prompt unchanged.
Create Protected Field Rule
Add a protected field rule to a scope's policy, creating the policy if needed. A policy is identified by scope_object_type (organization, project_group_projects, or project), scope_object_id, and restrict_object_type (project_log by default; use dataset for dataset rules). Ingest rules (stage "ingest", action "redact") redact detected entity_types inside field_paths before data is stored. Read rules (stage "read", action "hide") hide field_paths from readers who match protect_when and do not match allow_when. field_paths are arrays of keys or indexes, such as [["input"], ["metadata", "email"]]. protect_when and allow_when are expressions over row, partition, principal, and credential, for example "true", 'principal.user_id in ["<user id>"]', or '"<group id>" in principal.group_ids'. Read rules only support principal.user_id and principal.group_ids conditions.
Create Scheduled Loop Job
Create a custom Loop job that runs on an interval or cron schedule over a recent project-data window. The config must include Loop instructions and cannot include a threshold, so the job runs for every scheduled window. Delivery actions are exposed to Loop as tools.
Create Threshold Alert
Create a threshold alert for an aggregate over a recent project-data window. Use this for averages, counts, rates, percentages, percentiles, distributions, or other conditions evaluated on a schedule. config.threshold.calculation.btql_query must return at most one row with the numeric or null column named by config.threshold.calculation.output.value_column. Put any minimum sample size in the query, and do not add absolute time bounds because the runtime supplies the evaluation window. Use config.window.evaluation_delay_seconds when ingestion or asynchronous scoring arrives late. config.threshold.policy.pending_seconds controls how long a breach must persist, while renotify_interval_seconds controls reminders.
Delete Protected Field Rule
Delete a protected field rule by id. A policy is identified by scope_object_type (organization, project_group_projects, or project), scope_object_id, and restrict_object_type (project_log by default; use dataset for dataset rules).
Edit Dataset Rows
Insert, update, or delete up to 1000 Braintrust dataset rows using explicit operations. Target an existing dataset by ID or name. Set create_if_missing only when a new named dataset should be created.
Enable Topics Automation
Enable Topics for a Braintrust project. Before using this tool, load and follow "braintrust/topics-workflow" with load_braintrust_skill, then inspect existing automations with list_automations using kind "topic". Provide a distinct name to create an additional Topics automation; reusing a name returns the existing automation without changing it. This creates the configured facet topic maps, supports span, trace, or group scope, and defaults new automations to trace scope and the Task facet when omitted. It seeds processing for new traffic but does not rewind historical data.
Fail Dashboard Section
Report a failure for a precomputed dashboard section using the target and revision from its computation request. Keeps the last successful widgets.
Generate Dashboard Chart Sql
Generate a SQL-backed dashboard chart configuration for visualizing data from project_logs. The chart's query is authored directly as SQL, so it supports aggregates and shapes the structured chart definition cannot express: several percentiles of one field, expressions over multiple metrics, ratios of aggregates, count(distinct ...), and grouping by a time bucket plus another column. WRITING chartSql: - Every non-aggregate column you SELECT must also appear in a GROUP BY. The chart adds the time bucket, but never the GROUP BY — write it yourself. Those columns become the chart's groupings (one series per value); the aggregates are the plotted values. - Use count(1), not count(), to count rows. - For a percentage, rate, share, or proportion, select the raw fraction and set unitType to percent: count(CASE WHEN error IS NOT NULL THEN 1 END) / count(1), or sum(a) / sum(b). The chart multiplies by 100 when it renders, so a leading 100.0 * renders a true 68% as 6612% and a true 0.98 as 9800%. Never multiply by 100 yourself, and expect the selected value to sit between 0 and 1. CHOOSING A DATA SHAPE: - Default to the span shape, which is what project_logs() returns with no shape argument: one row per span. Aggregate over it for anything span-level — counts of LLM calls, per-call latency, token and cost sums. - To measure one span kind, filter in WHERE when every measure in the chart uses that kind: WHERE is_root lets the query skip other spans before reading them. Use a conditional such as avg(CASE WHEN is_root THEN metrics.duration ELSE NULL END) only when measures need different spans, since WHERE drops rows from every measure; a conditional evaluates every span in the time range, which is much slower on large projects. - Trace-level columns exist only on the summary shape, one row per trace: FROM project_logs(shape => 'summary'). These are metrics.llm_calls, metrics.total_tokens, metrics.prompt_tokens, and metrics.estimated_cost — always with the metrics. prefix, since the bare name is not a column. On the default shape they are null. Use summary only when the question is genuinely per-trace, such as end-to-end request latency or tokens per conversation, and expect one row per trace rather than per span. - Use summary sparingly: when the dashboard has any filter applied, the shape is rewritten to 'traces', and the trace-level columns are no longer there. A chart that reads correctly on an unfiltered page can break once a viewer filters it. BY CHART TYPE: - timeseries: return one or more aggregate values plus any non-aggregate groupings; omit the time column and bucket, the chart adds them. SELECT metadata.model AS model, avg(metrics.duration) AS duration FROM project_logs() GROUP BY model - singleValue: return at least one aggregate; only the first is displayed. SELECT count(1) AS spans FROM project_logs() - toplist: return at least one grouping plus the aggregates to rank by; the chart applies the sort and limit. SELECT metadata.model AS model, sum(metrics.tokens) AS tokens FROM project_logs() GROUP BY model - table: return an explicit projection with unique output names; an authored LIMIT is preserved. WHAT THE DASHBOARD ADDS AT RENDER TIME: - The time bucket and time column for timeseries charts. Do not select a time column or bucket yourself. - The timeframe filter, the page's filters, and any page-level group-by. - The project, if you write project_logs() with no argument. Anything you put in WHERE is combined with those, so filter only for what the chart itself needs. Column names vary by project. Inspect the actual columns with infer_schema or a sql_query before writing chartSql rather than assuming a field exists. Then run the chartSql itself with sql_query and read the rows back before generating the chart. Check that the values are the magnitude you expect, that the grouping columns hold real values rather than nulls, and that the row count is plausible. No rows, an all-null column, or a number that is orders of magnitude off means the query is wrong — fix it and re-run rather than charting it. For that check only, add a LIMIT and a time filter so the query stays cheap; the chartSql you submit must not contain either. When creating or editing a chart for a saved dashboard, read get_monitoring_view first and pass its view_id to this tool. Apply that view's saved search filters with its span/trace filter scope to your sql_query validation too, so the checked values and your answer match the preview. Keep dashboard filters out of chartSql.
Generate Permalink
Generate a direct web link (permalink) to a Braintrust object for sharing or bookmarking. This tool creates URLs that link directly to projects, experiments, datasets, prompts, functions, or specific log entries in the Braintrust web application. Use this when users want to: - Share a link to an experiment or dataset with teammates - Create bookmarks to specific objects - Generate URLs for external documentation or reports - Navigate directly to specific log entries or traces The tool accepts either object_id directly, or project_name + object_name to resolve the object first. Supply org_name to disambiguate names across organizations. For project_logs, project_patterns, project_prompts, and project_functions, project_name alone is sufficient; object_id must be the containing project UUID. For project_logs, put the root span ID from the query's root_span_id field in row_id, not a child span's id. For patterns, prompts, and scorers, put the resource ID in row_id.
Get Monitoring View
Inspect a saved Monitoring view, including its options and ordered chart definitions. Pass view_id: overview to read the built-in Overview's current AI section targets, instructions, artifact paths and publication revision. The built-in Overview is read-only. Copy returned chart_id values unchanged.
Get Project Settings
Get Braintrust project settings, including the configured field paths in settings.user_id_fields and settings.session_id_fields. Read these before grouping logs by user or session. If no session field is configured and each trace represents one session, group by root_span_id and state that assumption. The response also includes the effective default preprocessor, resolving an unset default to the built-in "thread" preprocessor.
Get Protected Field Policy
Get the protected field policy and its rules for a scope. A policy is identified by scope_object_type (organization, project_group_projects, or project), scope_object_id, and restrict_object_type (project_log by default; use dataset for dataset rules). Returns policy null when the scope has no policy.
Infer Schema
Look up field paths and types when the query depends on an unknown field. Pass only the relevant fields, such as ["metadata", "output"]. Request sample values only when the query depends on a value you do not know. This searches indexed data, so newly logged fields can take about 20 seconds to appear.
List Automations
List a project's automations, including online scoring rules, alerts, exports, retention policies, Topics automations, and other automation kinds. Returns complete configurations so an existing automation can be inspected before using a specialized update tool.
List Dataset Custom Views
List up to 100 saved custom views for labeling dataset rows in a project, including each view's code and a link reviewers can open. Use this to find an existing view to update with save_dataset_custom_view, or to reuse one as a template: copy its code, adjust it, and save it on another dataset under a new slug.
List Monitoring Views
List the saved Monitoring views and chart IDs for a project so the user can choose a view or chart to inspect or edit.
List Recent Objects
List recently created projects, experiments, datasets, prompts, or functions you have access to. You can use this to browse for objects and as a crude way of searching for objects (you will need to filter the results yourself). If an object you expect does not show up, then use the `starting_after` parameter to paginate through more results. If a user asks for something like "list my recent experiments", then you do not need to list through the set of projects. You can just provide the project name, and then list the experiments within that project. If you get an error, then perhaps the project name is incorrect, and you should fall back to listing projects first to find the one the user is referring to.
List Scheduled Loop Job Runs
List a saved scheduled Loop job's run threads, newest first, with thread IDs, names, and Braintrust links. Requires project read access and returns only threads visible to the caller. Pass next_cursor as cursor to continue with the same project and automation. Continuous jobs can reuse a thread for multiple executions. Does not return execution status, transcript contents, or delivery output.
List Slack Channels
List the Slack workspaces connected to a project's org and the public channels in a workspace, so a Slack alert action targets the channel the user named instead of a guessed ID. Call this before setting any Slack action's workspace_id and channel, passing the user's requested channel name as query. Match the requested channel to a returned channel and use its exact id; never invent or reuse a channel ID from context. If the org has multiple connected workspaces, workspace_id is null and channels is null until you call again with a specific workspace_id. If the channel isn't listed, ask the user for the channel ID rather than guessing.
Load Braintrust Skill
Load a guide when the request matches the workflow or SDK task described below. Use sql_query directly for ad hoc questions about Braintrust data. Available skills: - braintrust/automations-workflow: Set up, validate, and manage Braintrust alerts and scheduled Loop automations, including Patterns, threshold-triggered work, Slack or webhook delivery, and existing automation refinement. Use when a user asks to react to matching log or environment events, monitor a threshold, schedule recurring agent analysis, configure Patterns, or inspect an alert or Loop automation. - braintrust/bro: Restate the last message in plain human language, with no jargon. - braintrust/evaluator-workflow: Create, test, refine, deploy, rewind, and visualize Braintrust evaluators (scorers and classifiers) interactively. Use when a user asks to build or improve an evaluator, apply it to production logs with an online-scoring rule, backfill results, or review results. - braintrust/topics-workflow: Topics allow you to discover clusters from traces using a pipeline that involves preprocessing traces (converting raw trace data into a textual representation with JavaScript code), computing facets (using an LLM to convert the preprocessed data into 1-2 sentences), and clustering (using algorithms like HDBSCAN). These clusters are useful for discovering use cases, monitoring failures, and tracking these trends over time. Use when configuring, evaluating, or improving Topics, facets, preprocessors, or Topics automations. - braintrust/pattern-triage: Triage a specific saved pattern. Use when asked to check whether an existing pattern is still occurring, verify a fix, or or when investigating existing patterns. - agent-auto-improvement: Improve any Braintrust-instrumented agent by turning production traces into an offline eval loop: mine bad traces, build a failure taxonomy, capture cases in a remote Braintrust dataset, write scorers and an eval file, iterate on prompts/tools, and only then push online scorers. Use when the user wants to write evals for their agent, fix recurring production failures, or set up an auto-improvement loop for an LLM app. - pii-scrubbing: Wire up Braintrust span customizers to traverse span fields, then apply the requested scrubbing logic or ask what to scrub if unspecified. Includes LLM chat-message redaction examples and Python/TypeScript native and OpenTelemetry, Java, Go, and Ruby integrations. Loading a skill includes its supporting text files, labeled by relative path. Follow the returned guide for the matching task.
Lookup Api Keys
Look up Braintrust API keys and service tokens by exact IDs, exact name, or an explicit request to list all visible keys. Provide exactly one of api_key_ids, name, or list_all: true. Results follow the existing API-key and service-token visibility rules; inaccessible IDs remain unresolved. Use this to resolve span_attributes.created_by_api_key_id, which may identify either a personal API key or a service token. When resolving query results, deduplicate and pass all IDs in one call rather than making one call per ID. If an exact name lookup returns multiple possible keys, ask the user to disambiguate before continuing.
Lookup Users
Look up human Braintrust organization members by exact user IDs, partial name or email, or an explicit request to list all users. Provide exactly one of user_ids, search, or list_all: true. Use this to resolve span_attributes.created_by_user_id and Braintrust reviewer or assignee IDs. Do not interpret arbitrary metadata.user_id values as Braintrust organization users. When resolving query results, deduplicate and pass all user IDs in one call rather than making one call per ID. If a name search returns multiple possible users, ask the user to disambiguate before continuing.
Measure Pattern Frequency
Measure distinct users, sessions, or traces matched by a pattern in one time window of up to 14 days. Uses users when the configured end-user field covers at least half the traces, sessions when session IDs cover at least half, and traces otherwise. In code mode, JSON.parse the returned text and retain the result with store() for the pattern write. Pass that snapshot unchanged to new_pattern or update_pattern as evidence.frequency.snapshot.
Publish Dashboard Section
Publish one precomputed chart, Markdown note, or insight to a registered dashboard artifact target. Use the exact project_id, view_id, group_id, chart_id and revision from the automation run. Publish widgets:[] with unchanged:true when no update is needed. The server rejects outdated runs and unregistered targets.
Read Patterns Rubric
Read the project's Patterns rubric, which defines how to assign pattern severity and categories.
Resolve Attachments
Resolve one attachment reference or a batch from sql_query results into temporary download URLs. Provide the owning org_id and complete attachment references. Results preserve input order and include the original reference, upload status, and either a download URL or an individual error. URLs expire after five minutes; call again for fresh URLs. This tool only reads metadata and never downloads attachment contents. Treat URLs as sensitive and only download attachments whose upload status is done.
Resolve Object
Convert names to IDs (or vice versa) and parse Braintrust URLs. App URLs retain their organization scope. Pattern, prompt, and scorer links return the containing project as object_id and the resource as row_id; query that project collection with an id filter. Read docs://url-formats for supported URL patterns.
Rewind Topics Automation
Rewind an existing Topics automation to process historical data from an explicit start time or recent window. Before using this tool, load and follow "braintrust/topics-workflow" with load_braintrust_skill. Estimate the eligible population and obtain authorization for the historical scope before calling it.
Run Eval
Run a Braintrust experiment through the authenticated Eval API with a hosted dataset, inline rows, or a prior experiment, any saved or inline functional task, and zero or more saved or inline scorers. When a prior experiment is used as data, its outputs become expected values unless an expected value was already recorded. This does not require sandbox credentials. It creates an experiment and may execute user-supplied code or invoke AI providers, so it can incur compute and model usage. The MCP service supplies the caller's Braintrust token, forces streaming for long runs, and returns the experiment start metadata and final summary.
Run Scheduled Loop Job
Run a saved active scheduled Loop job using the same execution path as Run now in Braintrust. Runs its configured delivery actions and requires project update permission. Returns submission confirmation; use list_scheduled_loop_job_runs to find run links and inspect Past runs in Braintrust for completed output. Repeated calls can start additional runs, so do not resubmit to poll for progress.
Save Dataset Custom View
Create or update a versioned custom view that reviewers use to label rows of a dataset. Returns a link that opens the dataset with this view selected. By default, the tool fails if the slug already exists; set if_exists to replace to create a new version of that view, or ignore to leave it unchanged. To update or reuse an existing view, first read its code with list_dataset_custom_views.
Search Docs
Search Braintrust documentation to find relevant information and guidance. IMPORTANT: For SDK installation/setup tasks, do not use this tool. Instead, read the mcp resource docs://sdk-install This tool searches through the official Braintrust documentation using semantic search to find the most relevant content for your query. Use this tool to: - Learn more about what experiments, datasets, prompts, playgrounds, and logs are, and how to use them in the API or SDK. - Understand how to write evals and create scorers - Find sample code and guidance on how to add tracing for custom code as well as popular frameworks like the Vercel AI SDK. - Find code examples that are relevant to your use cases. What it returns: - Multiple documentation snippets ranked by relevance - Each snippet includes the content, headers hierarchy, and path - Content is Markdown formatted Example queries: - "How do I create an experiment?" - "Setting up scorers" - "Using metadata fields" - "Prompt playground features"
Search Patterns
Search existing patterns in a project by text, semantic similarity, ID, status, or quality. limit must be 1–100. Omit query for a listing. Ordinary listings and text searches use stable insertion order, newest first; while has_more is true, pass the returned cursor with the same project and filters to continue. Cursors do not support similar_to. Use similar_to with one or more existing pattern IDs or unreported pattern drafts to catch duplicates with different wording.
Send Feedback
Send feedback to the Braintrust team about a problem with this MCP server, such as a missing capability, a tool error that looks like a server bug, malformed or inconsistent output, or parameters that are confusing or rejected despite matching the schema. Use it when the user asks to report a problem, or when the user agrees to a report you offered. The report goes to the Braintrust team and does not change any project data. Refer to tools and parameters by name and to Braintrust objects by ID. Do not include trace or span contents, dataset rows, prompts, model inputs or outputs, query results, or argument values copied from project data.
Set Automation Status
Pause or activate an alert, scheduled job, or online scoring rule. This controls configured online scoring rules, not reusable scorer functions. Repeating the current status is a successful no-op.
Set Project Default Preprocessor
Set or clear the default preprocessor for a Braintrust project. When configuring Topics, first load and follow "braintrust/topics-workflow" with load_braintrust_skill. Pass a saved preprocessor reference, a global preprocessor such as "thread", or null to restore the built-in default. This changes the default used by facets and other project functions that do not explicitly select a preprocessor.
Set Project Session Id Field
Configure the project's session or conversation ID field and create its bloom index. Inspect multiple traces to identify the metadata or span_attributes field linking turns of the same conversation. Automatic discovery must leave only_if_unset true to preserve existing configuration. Explicit overrides require project update access. If the identifier exists only in input or output, report a tracing improvement pattern instead of configuring it.
Set Project User Id Field
Configure the project's derived end-user ID field and create its bloom index. Inspect traces to identify the application's end user in metadata or span_attributes. Automatic discovery must leave only_if_unset true to preserve existing configuration. Explicit overrides require project update access. If the identifier exists only in input or output, report a tracing improvement pattern instead of configuring it.
Set Topics Automation
Update an existing Topics automation's configuration. Before using this tool, load and follow "braintrust/topics-workflow" with load_braintrust_skill and inspect the current automation with list_automations using kind "topic". This changes facets, topic maps, scope, filters, sampling, or timing without rewinding historical data. Omitted settings keep their current values. facets only adds: each new facet gets a new topic map that has no topics until it is generated, and facets that are already configured are left unchanged. Removal is explicit: remove_facets removes facets and the topic maps generated from them, and remove_topic_map_ids removes specific topic maps. Removed topic maps' topics disappear from the Topics page. list_automations shows each topic map's source facet and whether it has topics. To switch a facet's version, add the new version and remove the old one in the same call. Calls that remove facets or topic maps are not safe to repeat: a repeated removal fails, and a repeated facet regeneration creates another new topic map. This tool cannot change a topic map's version pin; use unpin_topic_maps. Before adding or removing facets or topic maps, describe the changes to the user and get explicit approval.
Sql Query
Run one read-only Braintrust SQL (BTQL) query. Use it directly when the source and fields are known. Pass one complete SELECT in query. Use FROM project_logs('<project_id>'), experiment('<id>'), or dataset('<id>'). Log rows are spans by default. Scope log queries by created (e.g. created >= now() - interval 1 day) or by known IDs. Use is_root = true for root spans and span_attributes.type = 'llm' for model calls. Model usage fields include metrics.prompt_tokens, metrics.completion_tokens, and metrics.estimated_cost. Use infer_schema with specific fields when you need to discover a custom field. Do the filtering, math, grouping, and ranking in SQL. Select only the fields needed for the answer. Set an explicit LIMIT of at most 1000 rows. The default is 10. - Users and sessions: use get_project_settings to find configured identifier fields before grouping project logs by user or session. - Arrays: expand with UNPIVOT (item FOR _ IN (array_expr)). Use json_extract_string(item, '$.key') to read a property from mixed JSON elements. Use a bounded source subquery for large payload fields. - Time buckets: select date_trunc('day', created) AS day and COUNT(*) with GROUP BY day. Use one query for the whole time range. - Percentiles: percentile(value, p) returns an estimate. Pass p between 0 and 1, for example percentile(metrics.end - metrics.start, 0.95) for p95 latency. On data planes with exact percentile support, percentile_disc(value, p) returns the exact nearest rank, and PERCENTILE_CONT(p) WITHIN GROUP (ORDER BY value) interpolates between ranks. - Per-trace totals: GROUP BY root_span_id, then filter totals with HAVING SUM(metrics.estimated_cost) > <amount>. Select root_span_id directly for matching trace IDs. - Per-group ranking: aggregate in subqueries, then rank the complete grouped rows client-side if you need the row associated with each group's maximum. BTQL has no window functions, CTEs, or JOINs. - Rank root spans by elapsed time: on is_root = true, select root_span_id and MAX(metrics.end) - MIN(metrics.start) AS duration, then GROUP BY root_span_id ORDER BY duration DESC LIMIT <n>. This sorts grouped results in SQL. - Cross-span filters: use shape => 'traces' with WHERE ANY_SPAN(<span predicate>) to keep all spans of matching traces available for aggregation. Use SELECT DISTINCT root_span_id to list matching traces and ANY_SPAN(search('keyword')) for full-text search across a trace. To retrieve individual spans, query the matching root_span_id values. Use the lint message to adjust blocked queries. If sort pushdown fails, use ORDER BY created for chronological samples or sort the complete result client-side. To link to a trace, pass root_span_id as row_id to generate_permalink.
Summarize Experiment
Get aggregated performance metrics for an experiment, optionally compared to a baseline. Read docs://experiments for background. For row-level data, use sql_query.
Test Evaluator
Run one saved, global, or inline evaluator on representative inputs without writing results. Inputs may be inline evaluator rows containing fields such as input, output, expected, and metadata, or canonical span, trace, and group references. Inline rows can include only the fields the evaluator needs. The function field accepts a saved function_id, a global_function, or inline_evaluator using the same definition as create_evaluator. Inline evaluators do not need to be saved first. Inline code must define a top-level handler function. Use representative passes, failures, and ambiguous cases before creating an online-scoring rule.
Test Facet On Trace
Run an inline facet definition with a saved, global, inline, or project-default preprocessor on one to ten canonical span, trace, or group references concurrently using the same preview path as the Braintrust UI. Use run_eval for larger sets. Before using this tool, load and follow "braintrust/topics-workflow" with load_braintrust_skill. Do not use one or a few previews as a substitute for its representative-trace discovery stage. Inline facet previews use Braintrust's built-in facet model; callers do not select a model. This may call an AI provider and create invocation logs, but it does not write the facet result to the source trace.
Test Preprocessor On Trace
Run a saved, global, or inline preprocessor on one to 50 canonical span, trace, or group references concurrently using the same preview path as the Braintrust UI. For trace and group references, a custom preprocessor runs independently on each source span. Top-level array items are merged in trace order and exact-deduplicated; distinct joined transcript strings remain separate items, so return atomic items such as {role, content} for conversations. Each result is capped at 128 KiB, and model-visible previews share a 128 KiB budget. Use fewer inputs for more preview detail and run_eval for larger sets. When testing for Topics or a facet, first load and follow "braintrust/topics-workflow" with load_braintrust_skill. This executes code and may create invocation logs, but it does not write a score to the source trace.
Unpin Topic Maps
Remove version pins from topic maps on an existing Topics automation so they classify new traffic with each topic map's latest version. Before using this tool, load and follow "braintrust/topics-workflow" with load_braintrust_skill and inspect the current automation with list_automations using kind "topic". This only removes the version from the selected topic map references; facets, other topic maps, filters, and settings are unchanged. Labels change for new traffic only; historical data keeps its labels unless the automation is rewound. Before calling it, tell the user which topic maps will be unpinned and get explicit approval.
Update Dashboard Sql
Apply one or more SQL chart or section edits to an existing project dashboard. A dashboard is what list_monitoring_views and get_monitoring_view call a Monitoring view. Pass project_id and view_id. For a single chart edit, set the top-level operation to exactly insert, update, or remove. For section edits or bulk edits, pass an operations array instead; all operations are applied in order with one save. insert_group creates a section containing the provided existing chart_ids. remove_group deletes the section and keeps its charts at the section's position. Use get_monitoring_view first and copy its existing chart_id values unchanged. Every chart edit must include these fields, whether at the top level or inside operations: - insert: { operation: "insert", chart: chartConfig } - update: { operation: "update", chart_id: existingChartId, chart: chartConfig } - remove: { operation: "remove", chart_id: existingChartId } If the preview result is JSON text, parse it before reading chartConfig. For insert and update, chart must contain the complete chartConfig returned by generate_dashboard_chart_sql, even when the chart was already previewed. For batches, put each complete edit in operations and omit the top-level operation, chart_id, and chart fields. Only call this when the user explicitly asks to save the change.
Update Debug Report
Save or replace the diagnosis report for one trace. Use this after identifying concrete failure modes and evidence, or when a user asks to edit the existing diagnosis. Pass the complete replacement report, not a partial patch. Every evidence item should identify its supporting span and exact field or JSON path.
Update Online Scoring Rule
Save or rewind an online-scoring rule that runs saved evaluator functions. This tool is the approval surface for both mutations: state the proposed parameters, then call it without asking the user to type a separate confirmation. For save, provide function_ids, the rule scope, filters, and sampling rate. New rules default to paused; pass status active only when the user has authorized processing new traffic. Existing rules preserve their status when omitted. A group scope requires group_by and placement and accepts optional interval_seconds and max_traces. For rewind, require an existing active automation_id and choose start_time from the user's requested window. Activate a paused rule with set_automation_status before rewinding it. Do not repeatedly resubmit it to poll for progress.
Update Pattern
Update an existing project pattern's content, source review, status, quality, or feedback, and optionally attach quoted evidence to matching traces. Closing an active pattern saves the reason as feedback. Before using this tool, use search_patterns to inspect the current pattern. Backfill a missing source_review after triage; omit it to preserve the saved review. When revising evidence, include Frequency (evidence.frequency) whenever measurable; other monitors are optional additions. Reactivated Patterns automatically notify the configured project Pattern alert destinations; do not send a separate alert.
Update Protected Field Rule
Update fields of an existing protected field rule by id. Omitted fields are unchanged; set enabled to false to pause a rule. A policy is identified by scope_object_type (organization, project_group_projects, or project), scope_object_id, and restrict_object_type (project_log by default; use dataset for dataset rules). Ingest rules (stage "ingest", action "redact") redact detected entity_types inside field_paths before data is stored. Read rules (stage "read", action "hide") hide field_paths from readers who match protect_when and do not match allow_when. field_paths are arrays of keys or indexes, such as [["input"], ["metadata", "email"]]. protect_when and allow_when are expressions over row, partition, principal, and credential, for example "true", 'principal.user_id in ["<user id>"]', or '"<group id>" in principal.group_ids'. Read rules only support principal.user_id and principal.group_ids conditions.
Community feedback
Sign in with your B-Bot account to like or review.
Reviews
No reviews yet. Be the first to leave feedback.