Skip to main content
Glama
RudrenduPaul

NeuronScope MCP Server

trace

Run a forward pass on an open-weight language model to identify the attention heads and MLP neurons most responsible for its predicted next token, explaining why the model made that prediction.

Instructions

Run a forward pass of a small-to-medium open-weight language model (via TransformerLens) on one prompt, and report which attention heads and MLP neurons were most responsible for its predicted next token: heads ranked by direct logit attribution, neurons ranked by activation magnitude at the final prompt position. Call this to answer 'why did the model predict X' for a specific prompt. It only works on models TransformerLens's HookedTransformer.from_pretrained supports (GPT-2, Pythia, Llama, Gemma, Qwen, and similar open-weight checkpoints), not closed-source APIs like OpenAI or Anthropic models. Read-only and deterministic for a given model, prompt, and top_k: it writes nothing except the model's own weights, which HuggingFace Hub downloads to a local cache (~/.cache/huggingface) the first time a given model name is requested (needs network access that one time; later calls for the same model run offline from cache). Runs on CPU by default and can be slow for large models. On failure (an unsupported model name, or a prompt longer than the model's context window) it returns a structured error object instead of raising, so the tool call itself never fails silently. Parameters: model (str) is any name HookedTransformer.from_pretrained accepts, e.g. 'gpt2' or 'EleutherAI/pythia-70m'; prompt (str) is the input text; top_k (int, default 10) caps how many top heads and neurons are returned. Example call: model='gpt2', prompt='The capital of France is Paris. The capital of Japan is', top_k=5. Returns JSON with schema_version, operation, model (resolved name, backend, device, and layer/head/dimension counts), prompt, predicted_token, predicted_token_id, top_neurons (list of {layer, neuron_index, activation}), and top_heads (list of {layer, head_index, logit_attribution}).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYes
top_kNo
promptYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses read-only and deterministic behavior, the network/cache side effect on first use, CPU default performance, and the structured error return on failure. This is rich behavioral context far beyond the basic facts.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is lengthy but every sentence earns its place: purpose, use case, model support, constraints, failure behavior, and parameter definitions. It front-loads the primary purpose and then methodically covers context, making it efficiently structured for its complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity, the description covers all essential context: output schema elements, failure modes, network behavior, performance caveats, and supported model families. It is complete enough for an agent to invoke correctly and interpret results, especially with the detailed return signature.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has no parameter descriptions (0% coverage), so the description must compensate. It explains 'model' with accepted name examples, 'prompt' as input text, and 'top_k' with default and meaning (caps how many top heads and neurons). This adds meaning well beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Run a forward pass... and report which attention heads and MLP neurons were most responsible for its predicted next token.' It clearly answers 'why did the model predict X' for a specific prompt, distinguishing it from sibling tools like activations, patch, and circuit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Call this to answer why did the model predict X for a specific prompt,' which is clear when-to-use guidance. It also provides when-not-to-use constraints (only TransformerLens-supported open-weight models, not closed-source APIs). However, it does not name alternative sibling tools for other interpretability tasks, so it lacks explicit alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RudrenduPaul/NeuronScope'

If you have feedback or need assistance with the MCP directory API, please join our Discord server