# Llama Index Tools Ejentum

> LlamaIndex tool spec for the Ejentum Reasoning Harness. Wraps the hosted Ejentum MCP server and exposes 8 tools (4 harnesses Ã— dynamic + adaptive).

- **Type:** MCP server
- **Install:** `agentstack add mcp-ejentum-llama-index-tools-ejentum`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ejentum](https://agentstack.voostack.com/s/ejentum)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ejentum](https://github.com/ejentum)
- **Source:** https://github.com/ejentum/llama-index-tools-ejentum
- **Website:** https://ejentum.com

## Install

```sh
agentstack add mcp-ejentum-llama-index-tools-ejentum
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# llama-index-tools-ejentum

[LlamaIndex](https://www.llamaindex.ai) tool spec that subclasses `McpToolSpec` and points at the hosted Ejentum MCP server. Exposes the eight cognitive-harness tools as LlamaIndex `FunctionTool` objects ready for any LlamaIndex agent or query engine.

Use the harness before the agent generates on complex, multi-step, or multi-constraint tasks where the model's default reasoning template would miss a constraint, take a shortcut, or drift across turns. Each call returns a *cognitive operation*: a structured procedure (numbered steps with a failure pattern to refuse and a falsification test) paired with an executable reasoning topology (a DAG of those steps with decision gates, parallel branches, bounded loops, and meta-cognitive exit nodes). The agent reads both layers before producing its response.

Four dynamic tools (`reasoning`, `code`, `anti-deception`, `memory`) are available on all tiers including the 30-day free trial. Four adaptive tools (`adaptive-reasoning`, `adaptive-code`, `adaptive-anti-deception`, `adaptive-memory`) additionally run an adapter LLM that rewrites the matched operation with task-specific identifiers; they require the Go or Super tier.

Tool names exposed to the LLM are whatever the upstream MCP server advertises (canonical hyphenated strings: `reasoning`, `code`, `anti-deception`, `memory`, `adaptive-reasoning`, `adaptive-code`, `adaptive-anti-deception`, `adaptive-memory`). This shim does not rename them.

## Install

```bash
pip install llama-index-tools-ejentum
```

## Configuration

```bash
export EJENTUM_API_KEY="ej_..."
```

Or pass `api_key=` to `EjentumToolSpec(...)`. Get a key at [ejentum.com/pricing](https://ejentum.com/pricing).

## Usage

### Minimal

```python
from llama_index.tools.ejentum import EjentumToolSpec

spec = EjentumToolSpec()
tools = spec.to_tool_list()
```

### Subset of modes

```python
spec = EjentumToolSpec(modes=["reasoning", "code", "adaptive-reasoning", "adaptive-code"])
tools = spec.to_tool_list()
```

Valid mode names (use canonical hyphenated form): `reasoning`, `code`, `anti-deception`, `memory`, `adaptive-reasoning`, `adaptive-code`, `adaptive-anti-deception`, `adaptive-memory`.

### With a ReActAgent

```python
from llama_index.core.agent import ReActAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.ejentum import EjentumToolSpec

tools = EjentumToolSpec().to_tool_list()
agent = ReActAgent.from_tools(tools, llm=OpenAI(model="gpt-4o-mini"))

response = await agent.achat(
    "Why might our microservice return 503s only under specific load patterns?"
)
```

## Tool inventory

### Dynamic (all tiers)

| Tool | Library size |
|---|---:|
| `reasoning` | 311 |
| `code` | 128 |
| `anti-deception` | 139 |
| `memory` | 101 |

### Adaptive (Go or Super tier)

| Tool |
|---|
| `adaptive-reasoning` |
| `adaptive-code` |
| `adaptive-anti-deception` |
| `adaptive-memory` |

Each tool takes a single `query: str` argument. Returns the injection as a string.

## API reference

```python
EjentumToolSpec(
    api_key: str | None = None,
    modes: list[str] | None = None,
    api_url: str = "https://api.ejentum.com/mcp",
    timeout: int = 30,
)
```

| Field | Default | Description |
|---|---|---|
| `api_key` | `None` | If unset, read from `EJENTUM_API_KEY`. Raises `ValueError` at construction if neither is set. |
| `modes` | `None` | Optional subset of harness modes to expose. Defaults to all eight. |
| `api_url` | `https://api.ejentum.com/mcp` | Override for self-hosted MCP gateway. |
| `timeout` | `30` | HTTP timeout in seconds for the underlying MCP client. |

The class is a thin subclass of `llama_index.tools.mcp.McpToolSpec`, pre-configured with the hosted Ejentum endpoint and Bearer authentication.

## Wire contract

This shim talks to the **MCP** endpoint (`/mcp`), not the direct-REST endpoint (`/harness/`). For the direct-REST contract used by every other Ejentum shim, see the [ejentum-mcp README](https://github.com/ejentum/ejentum-mcp#wire-contract); for the MCP-over-streamable-HTTP contract, see the [MCP specification](https://modelcontextprotocol.io).

Field structure of an injection and a canonical dynamic-vs-adaptive comparison on the same query are documented in the [ejentum-mcp README](https://github.com/ejentum/ejentum-mcp#canonical-example-dynamic-vs-adaptive-on-the-same-query).

## The underlying MCP server

The same MCP server is available on three additional surfaces:

- Stdio via `npx -y ejentum-mcp`
- Hosted Streamable HTTP at `https://api.ejentum.com/mcp`
- Listed on the [Official MCP Registry](https://registry.modelcontextprotocol.io/) as `io.github.ejentum/ejentum-mcp`

## Compatibility

- Python 3.10+
- `llama-index-core>=0.13.0,=0.4.1,<0.5`

## License

[MIT](./LICENSE)

## Measured effects

The Ejentum harness is benchmarked publicly under CC BY 4.0 at [github.com/ejentum/benchmarks](https://github.com/ejentum/benchmarks):

- **ELEPHANT** sycophancy: 5.8% composite on GPT-4o (40 real Reddit scenarios)
- **LiveCodeBench Hard**: 85.7% to 100% on Claude Opus (28 competitive programming tasks)
- **Memory retention**: 50% fewer stale facts served (20-turn implicit state changes)
- Plus per-harness numbers across BBH/CausalBench/MuSR, ARC-AGI-3, SciCode, and perception tasks

Methodology, scenarios, run scripts, and raw outputs are all in-repo.

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ejentum](https://github.com/ejentum)
- **Source:** [ejentum/llama-index-tools-ejentum](https://github.com/ejentum/llama-index-tools-ejentum)
- **License:** MIT
- **Homepage:** https://ejentum.com

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-ejentum-llama-index-tools-ejentum
- Seller: https://agentstack.voostack.com/s/ejentum
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
