<a id="agents-catalog"></a>
<a id="id1"></a>
# Agents Catalog

The following agents are available in TrialGrid:

| Agent | Description | Platforms | Available In |
| --- | --- | --- | --- |
| Bulk Edit Check Creator | Build edit checks from specifications in bulk | Medidata | Draft |
| Custom Diagnostic Agent | Create and edit Custom Diagnostics | All | URL, Project, Draft |
| Custom Function Agent | Create Custom Functions from natural language descriptions | Medidata | Draft |
| Custom Function Reviewer | Review custom functions for bugs | Medidata | Draft |
| Edit Check Agent | Create and edit Edit Checks | Medidata | Draft |
| Field Visibility Advisor | Analyze and fix field visibility settings and edit checks | Medidata | Draft |
| Help Agent | Get help and answers from documentation | All | Global, URL, Project, Draft |
| Progressive Display Advisor | Analyze progressive display settings on items | Veeva | Draft |
| Specification Review | Review specifications and resolve object ambiguities | All | Draft |
| Test Case Agent | Create and edit Test Cases | Medidata | Draft |
| Test Case Search | Search and find test cases by name, status, or content | All | Project, Draft |
| Veeva Test Case Agent | Create and edit Test Cases for Veeva Vault EDC | Veeva | Draft |

<a id="bulk-edit-check-creator"></a>
## Bulk Edit Check Creator

Build edit checks from specifications in bulk

**Platforms:** Medidata

**Available in:** Draft

This agent builds edit checks from specifications in bulk — either the metadata attached to existing empty checks (which it fills in) or custom specification objects (from which it creates new checks). Each result is classified as created, review-required, custom-function-required, or failed, and drives configurable per-outcome action hooks.

**Action Hooks:**

- **created_high_confidence** — Fires for each check created/updated with high confidence

  Available variables for action preconditions (via `agent()`):

  - `agent("outcome")` (text) — Name of the hook that fired: "created_high_confidence", "created_review_required", "custom_function_required" or "build_failed"
  - `agent("created")` (True/False) — True when a new check was created, False otherwise
  - `agent("updated")` (True/False) — True when an existing check was filled in, False otherwise
  - `agent("check_name")` (text) — Name of the check

- **created_review_required** — Fires for each check that was built but needs human review

  Available variables for action preconditions (via `agent()`):

  - `agent("outcome")` (text) — Name of the hook that fired: "created_high_confidence", "created_review_required", "custom_function_required" or "build_failed"
  - `agent("reason_count")` (number) — Number of reasons the check needs review
  - `agent("check_name")` (text) — Name of the check

- **custom_function_required** — Fires for each specification that requires a custom function

  Available variables for action preconditions (via `agent()`):

  - `agent("outcome")` (text) — Name of the hook that fired: "created_high_confidence", "created_review_required", "custom_function_required" or "build_failed"
  - `agent("reason")` (text) — Why the specification needs a custom function

- **build_failed** — Fires for each specification that could not be built

  Available variables for action preconditions (via `agent()`):

  - `agent("outcome")` (text) — Name of the hook that fired: "created_high_confidence", "created_review_required", "custom_function_required" or "build_failed"
  - `agent("error")` (text) — Why the build failed

<a id="custom-diagnostic-agent"></a>
## Custom Diagnostic Agent

Create and edit Custom Diagnostics

**Platforms:** All

**Available in:** URL, Project, Draft

<a id="custom-function-agent"></a>
## Custom Function Agent

Create Custom Functions from natural language descriptions

**Platforms:** Medidata

**Available in:** Draft

The Custom Function Agent helps create Medidata Rave custom functions (C#) from natural language descriptions. It uses deterministic C# scaffolding templates for common patterns, with the LLM generating only the comparison logic.

**Capabilities:**

- Generate C# custom functions from templates
- Write the Rave API the Rave URL is set to, V1 or V2, and say which was used; a function is not converted from one to the other
- Discover forms, fields, folders, and matrices in the current draft
- Validate syntax locally (tree-sitter) and by compiling through Medidata Designer
- Save custom functions to the draft

**Required Permission:** Drafts.Edit Objects

NOTE: The Custom Function Agent may struggle with more complex custom functions. Please review all code generated by the agent carefully.

<a id="custom-function-reviewer"></a>
## Custom Function Reviewer

Review custom functions for bugs

**Platforms:** Medidata

**Available in:** Draft

This agent analyzes custom function source code to identify logic bugs, missing null checks, unreferenced OIDs, and other quality issues. Results include a pattern classification, pseudo-code summary, and actionable findings with severity levels. A function is reviewed against the Rave API it is written with, V1 or V2, and one that mixes the two is told so.

**Action Hooks:**

- **review_saved** — Fires when custom function reviews are saved

  Available variables for action preconditions (via `agent()`):

  - `agent("error_count")` (number) — Number of error-severity findings for this custom function

<a id="edit-check-agent"></a>
## Edit Check Agent

Create and edit Edit Checks

**Platforms:** Medidata

**Available in:** Draft

Drives discovery, ambiguity resolution, generation, and save as deterministic transitions; uses structured-output LLM calls for CQL + actions production.

**Action Hooks:**

- **edit_check_saved** — Fires when an edit check is created or updated

  Available variables for action preconditions (via `agent()`):

  - `agent("edit_check_created")` (True/False) — True when a new edit check is created, False otherwise
  - `agent("edit_check_updated")` (True/False) — True when an existing edit check is updated, False otherwise

<a id="field-visibility-advisor"></a>
## Field Visibility Advisor

Analyze and fix field visibility settings and edit checks

**Platforms:** Medidata

**Available in:** Draft

This agent analyzes form fields to identify which should be hidden by default based on their context (pretext). It can then fix fields to be hidden, create SetDataPointVisible edit checks to show them when appropriate conditions are met, and generate test cases for the created checks.

<a id="help-agent"></a>
## Help Agent

Get help and answers from documentation

**Platforms:** All

**Available in:** Global, URL, Project, Draft

The Help agent searches and retrieves information from the application documentation. It can answer questions about how to use features, find relevant help topics, and explain diagnostic rules.

**Capabilities:**

- Search documentation topics by keyword
- Read and summarize help articles
- Search available test steps (Given/When/Then commands)
- Search diagnostic rules and their descriptions

**Data Access:**

This agent only reads documentation and does not modify any data. It accesses the built-in help system and step/diagnostic catalogs.

<a id="progressive-display-advisor"></a>
## Progressive Display Advisor

Analyze progressive display settings on items

**Platforms:** Veeva

**Available in:** Draft

This agent analyzes items to identify which should be conditionally displayed based on another item's value. It checks whether the necessary Controlling Item and Controlling Item Values are correctly configured.

<a id="specification-review"></a>
## Specification Review

Review specifications and resolve object ambiguities

**Platforms:** All

**Available in:** Draft

The Specification Review agent discovers draft objects referenced by a specification and resolves any object ambiguities before other agents (Test Case Creator, Edit Check Creator) are invoked.

**Capabilities:** - Read and analyze specification custom objects - Discover referenced draft objects (forms, fields, events, items) - Identify object ambiguities (items on multiple forms, forms in multiple folders) - Walk through ambiguity resolution interactively **Data Access:** This agent can **read** draft structure and specification properties.

**Action Hooks:**

- **review_complete** — Fires when the specification review is complete

  Available variables for action preconditions (via `agent()`):

  - `agent("ambiguity_count")` (number) — Number of unresolved ambiguities (total minus resolved and skipped)
  - `agent("resolved_count")` (number) — Number of ambiguities resolved by the user
  - `agent("skipped_count")` (number) — Number of ambiguities skipped by the user
  - `agent("unresolved_issue_count")` (number) — Number of unresolved structural issues
  - `agent("custom_function_required")` (text) — Whether the specification requires a custom function: 'true', 'false', or 'unknown'

<a id="test-case-agent"></a>
## Test Case Agent

Create and edit Test Cases

**Platforms:** Medidata

**Available in:** Draft

Drives discovery, ambiguity resolution, generation, and save as deterministic transitions; uses structured-output LLM calls for Gherkin scenarios production.

**Action Hooks:**

- **test_case_saved** — Fires when a test case is created or updated

  Available variables for action preconditions (via `agent()`):

  - `agent("test_case_created")` (True/False) — True when a new test case is created, False otherwise
  - `agent("test_case_updated")` (True/False) — True when an existing test case is updated, False otherwise

<a id="test-case-search"></a>
## Test Case Search

Search and find test cases by name, status, or content

**Platforms:** All

**Available in:** Project, Draft

The Test Case Search agent helps find test cases across your project or within a specific draft. It can search by various criteria and display detailed results.

**Capabilities:**

- Search test cases by name, content, or last run status
- Filter by forms, fields, or folders used in test cases
- Filter by roles used in test cases
- View test case details and content
- Get failure details and error messages from failed test runs
- List drafts with test case counts (at project scope)
- Count test cases per draft with filters (e.g., "how many failed per draft")

**Data Access:**

This agent only **reads** test case data and run results. It cannot create, modify, or delete test cases. Use the Test Case Agent to create or edit test cases.

**Required Permission:** Drafts.Manage Tests

<a id="veeva-test-case-agent"></a>
## Veeva Test Case Agent

Create and edit Test Cases for Veeva Vault EDC

**Platforms:** Veeva

**Available in:** Draft

Drives discovery, ambiguity resolution, generation, and save as deterministic transitions; uses structured-output LLM calls for Gherkin scenario production.

**Action Hooks:**

- **test_case_saved** — Fires when a test case is created or updated

  Available variables for action preconditions (via `agent()`):

  - `agent("test_case_created")` (True/False) — True when a new test case is created, False otherwise
  - `agent("test_case_updated")` (True/False) — True when an existing test case is updated, False otherwise
