MCP ReferenceMCP Resources

MCP Resources

The Invarium MCP server exposes four read-only resources via the MCP protocol. These resources provide templates, prompt guides, and code that MCP clients can read to support the agent testing workflow.

Resources are accessed using invarium:// URIs. Your MCP client reads them automatically when the server instructions reference them, or you can request them explicitly.


How Resources Work

MCP resources are read-only data that the server makes available to clients. Unlike tools (which perform actions), resources simply return content — a JSON template, a markdown guide, or a Python file.

When the Invarium MCP server instructions tell the client to “read the invarium://templates/trace-prompt resource,” the client fetches that resource’s content and uses it to guide the next step.


Available Resources

invarium://templates/agent-blueprint

FieldValue
URIinvarium://templates/agent-blueprint
MIME typetext/yaml
PurposeYAML template for describing an AI agent

The agent blueprint template is a structured YAML document that defines the schema for registering an agent with Invarium. It includes placeholders for all required and optional fields.

Contents:

The template defines the following top-level sections:

SectionDescription
agent_nameThe agent’s identifier (kebab-case).
frameworkThe AI framework used (e.g., langchain, crewai, openai).
descriptionA one-sentence summary of what the agent does.
toolsArray of tool definitions, each with name, description, parameters (JSON Schema), returns, side_effects, requires_confirmation, and error_handling.
workflowExecution flow with an entry_point and chains (named sequences of tool invocations with trigger conditions).
constraintsBehavioral rules including system_prompt_summary, guardrails, rate_limits, and max_retries.
graphAgent Intelligence Graph with nodes (Chain, Tool, Guard, ExternalService, PolicyConstraint) and edges (CAN_INVOKE, CHAINS_TO, GUARDED_BY, READS, WRITES).
metadataGeneration metadata: generated_by, generated_at, confidence (high/medium/low).

When it is used:

The MCP server reads this resource during Phase 1 (Agent Registration) to provide the blueprint structure. The client fills in the template by analyzing the agent’s codebase, then passes it to invarium_prepare_blueprint for validation.

See Blueprint Schema for the full field reference.


invarium://templates/blueprint-prompt

FieldValue
URIinvarium://templates/blueprint-prompt
MIME typetext/markdown
PurposeStep-by-step instructions for generating an agent blueprint from source code

The blueprint prompt is a markdown guide that instructs the MCP client on how to analyze an AI agent’s codebase and produce a valid blueprint YAML.

Contents:

The prompt walks through seven steps:

StepDescription
Step 1: Identify the Agent FrameworkScan imports for LangChain, CrewAI, AutoGen, OpenAI Agents SDK, OpenAI SDK (custom), or custom patterns.
Step 2: Extract ToolsFind all tool definitions across framework-specific patterns (@tool decorators, StructuredTool, function calling schemas, @function_tool). Extract name, description, parameters, returns, side effects, confirmation requirements, and error handling.
Step 3: Map WorkflowTrace execution flow from entry point through chains, routers, conditional branches, loops, and parallel execution.
Step 4: Detect ConstraintsIdentify system prompt instructions, guardrails (input/output validation, permission checks, content moderation), rate limits, and retry configuration.
Step 5: Output Blueprint YAMLProduce the complete blueprint YAML matching the schema from the template resource.
Step 6: Generate Agent Intelligence GraphBuild a multi-path DAG with classified tool nodes (Discovery, Enrichment, Action), guard nodes, policy nodes, external service nodes, and execution flow edges.
Step 7: Discover Sample DataSearch the codebase for seed files, fixtures, and test data to populate the sample_data field with real parameter values. Improves test case realism and coverage.

The prompt also includes a confidence scoring rubric that rates the completeness of the generated blueprint as High, Medium, or Low.

When it is used:

The MCP client reads this resource when the user wants to register or update their agent. The client follows the prompt’s instructions to analyze the codebase and generate a blueprint, which is then validated with invarium_prepare_blueprint.


invarium://templates/trace-library

FieldValue
URIinvarium://templates/trace-library
MIME typetext/x-python
PurposeSingle-file behavioral tracer for capturing tool calls during test execution

The trace library is a Python file (invarium_trace.py) that the MCP client saves to .invarium/invarium_trace.py in the user’s project directory. It captures tool calls, LLM interactions, and behavioral data during test execution and streams results to the Invarium dashboard.

Capabilities:

FeatureDescription
LLM interaction captureCaptures behavioral data from your agent’s LLM interactions.
PII redactionIncludes automatic PII redaction before data leaves your machine.
Zero dependenciesNo additional pip packages required beyond what the agent already uses.
Two usage modesImport mode (use in your Python code) and CLI wrapper mode (run from the command line).
Live streamingResults stream to the dashboard individually as each test case completes.
Behavioral fingerprintTracks tool call patterns for determinism analysis.

Usage modes:

  • Import mode — wrap the agent invocation in a tracing context within your Python code.
  • Batch mode — run a list of test cases with automatic result streaming to the dashboard.

When it is used:

Prefer using invarium_setup_tracing instead of reading this resource directly — it downloads the tracer more efficiently without passing the full file through the conversation.

⚠️

Do not modify invarium_trace.py after saving it. The file is managed by Invarium and may be updated in future versions. Modifications can break tracing or result in incomplete data.


invarium://templates/trace-prompt

FieldValue
URIinvarium://templates/trace-prompt
MIME typetext/markdown
PurposeStep-by-step guide for running behavioral test cases with tracing

The trace prompt is a markdown guide that instructs the MCP client on how to set up and execute test cases against an agent with full behavioral tracing enabled.

Contents:

The prompt covers three steps:

StepDescription
Step 1: Set Up the TracerCall invarium_setup_tracing to install the trace library as .invarium/invarium_trace.py. Alternatively, read the invarium://templates/trace-library resource and save it manually.
Step 2: Write the Test ScriptCreate test_run.py using the batch runner pattern. The script must invoke the agent the same way its API endpoint does. Includes framework-specific examples for LangChain and Google Gemini agents.
Step 3: Create Test Run and ExecuteCall invarium_sync_results with create_empty=True to create a test run, share the dashboard link, update the script with the test_run_id, and run the script in the background.

Framework-specific guidance:

The prompt includes tailored setup instructions for:

  • LangChain agents — framework-specific configuration for full tracing
  • Google Gemini agents — configuration for tool call visibility
  • General agents — standard batch runner setup

When it is used:

The MCP client reads this resource when the user is ready to execute test cases (Phase 3). The client follows the prompt’s instructions to create the test script and run it against the agent.


Accessing Resources

Resources are typically read automatically by the MCP client when following the server’s workflow instructions. You do not need to call a tool to access them.

If your MCP client supports listing resources, you will see all four resources listed with their URIs, MIME types, and descriptions.

In the Workflow

Workflow PhaseResources Used
Phase 1: Agent Registrationinvarium://templates/agent-blueprint, invarium://templates/blueprint-prompt
Phase 3: Test Executioninvarium://templates/trace-library, invarium://templates/trace-prompt
Was this page helpful?