Skip to main content

Interpretability -- MCP Tool Specification

Version: v1.1.9 | Status: Active | Last Updated: March 2026

Overview​

This document defines the MCP tools exposed by the interpretability module. These tools are auto-discovered by the PAI MCP bridge via the @mcp_tool decorator in mcp_tools.py and surfaced as part of the ~303 dynamic tools available to Claude.

Auto-Discovery​

PropertyValue
Discovery method@mcp_tool decorator scan
Namespaceinterpretability
Trust defaultSafe
PAI bridgesrc/codomyrmex/agents/pai/mcp/

Tool Reference​

sae_train​

Description: Train a Sparse Autoencoder on activation data for mechanistic interpretability. Trust Level: Safe Category: analysis

Parameters:

ParameterTypeRequiredDefaultDescription
d_inputintYes--Input activation dimensionality
d_featuresintNoNoneNumber of sparse features (defaults to 4x d_input)
n_samplesintNo200Number of random activation samples to generate
n_stepsintNo50Training steps
lambda_l1floatNo1e-3L1 sparsity penalty
seedintNoNoneRandom seed

Returns: dict[str, Any] -- Dictionary with d_input, d_features, final_loss, analysis (top features, sparsity metrics), and status.

Example:

from codomyrmex.interpretability.mcp_tools import sae_train

result = sae_train(d_input=64, d_features=256, n_steps=100, lambda_l1=0.01, seed=42)

sae_analyze​

Description: Analyze features learned by a Sparse Autoencoder on provided activations. Trust Level: Safe Category: analysis

Parameters:

ParameterTypeRequiredDefaultDescription
d_inputintYes--Input dimensionality
d_featuresintNoNoneNumber of sparse features
n_samplesintNo200Number of activation samples
seedintNo42Random seed

Returns: dict[str, Any] -- Dictionary with feature analysis: top features, sparsity, activation frequencies, and status.

Example:

from codomyrmex.interpretability.mcp_tools import sae_analyze

result = sae_analyze(d_input=128, d_features=512, n_samples=500, seed=42)

Integration Notes​

  • Auto-discovered: Yes (via @mcp_tool in mcp_tools.py)
  • Trust Gateway: All tools are safe -- no destructive operations
  • PAI Phases: OBSERVE (feature analysis), THINK (mechanistic interpretability)
  • Dependencies: Requires numpy and internal sae module (SparseAutoencoder, train_sae, analyze_features)