> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rippletide.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Tools & Resources

> All tools and resources exposed by the Context Graph via MCP

## System prompt

Add this to your agent's system prompt so it knows how to use the MCP tools effectively. You can copy it directly from the Rippletide playground (terminal icon in the header).

```text theme={null}
You have access to a persistent context graph via MCP tools.

TOOLS:
- remember(content, category, entities?, confidence?): Store a fact, preference, intent, decision, or context. Categories: fact, preference, intent, decision, context. Entity types: Person, Organization, Product, Amount, Date, Location, Concept, Decision, Action.
- recall(query, limit?): Search memories by keyword or topic. Always search before answering fact-based questions.
- get_context(entity_name): Get complete details about a specific entity and all linked memories/relationships.
- list_entities(type?): List all known entities, optionally filtered by type.
- invalidate(memory_id, reason?): Mark a memory as outdated or incorrect.
- relate(source, target, relation_type): Create a relationship between entities. Types: works_at, wants, has, is_a, related_to, caused, approved, declined, lives_in, resulted_in, mentioned_with.

BEST PRACTICES:
- ALWAYS recall() before answering fact-based questions
- ALWAYS remember() decisions, preferences, and key facts mentioned by the user
- Use invalidate() + remember() to correct stale information
- Set confidence: 1.0 for explicit facts, 0.5-0.8 for inferred information
- Create relations between entities to build a meaningful graph
```

<Tip>
  This is the same text copied by the **"Copy context instructions"** button in the playground.
</Tip>

## How tools work

Your AI assistant calls these tools **automatically** during conversations. You don't invoke them manually. When you mention a decision, the assistant calls `remember`. When you ask about something from the past, it calls `recall`. The tools are the building blocks of the assistant's memory.

## Typical workflow

Here's how the tools work together in a real conversation:

1. **`remember`**: Store a new fact ("The client wants premium support")
2. **`relate`**: Link entities ("Client -> wants -> premium support")
3. **`recall`**: Later, search for that information ("What does the client want?")
4. **`get_context`**: Get everything about an entity ("Tell me about the client")
5. **`invalidate`**: Mark outdated info ("The client switched to basic support")

## Tools (7)

### remember

Store a fact, preference, intent, or decision in the agent's memory.

```json theme={null}
{
  "content": "Client prefers email communication over phone",
  "category": "preference",
  "entities": [
    { "name": "John Doe", "type": "Person" }
  ],
  "confidence": 0.95
}
```

| Parameter    | Type   | Required | Description                                                   |
| ------------ | ------ | -------- | ------------------------------------------------------------- |
| `content`    | string | Yes      | The memory content to store                                   |
| `category`   | string | Yes      | One of: `fact`, `preference`, `intent`, `decision`, `context` |
| `entities`   | array  | No       | Entities this memory is about (name + type)                   |
| `confidence` | number | No       | Confidence level 0-1 (default: 0.9)                           |
| `sourceText` | string | No       | Original text this was extracted from                         |

### recall

Search the agent's memories by keyword or topic.

```json theme={null}
{
  "query": "pricing preferences",
  "limit": 5
}
```

| Parameter | Type   | Required | Description               |
| --------- | ------ | -------- | ------------------------- |
| `query`   | string | Yes      | Search query              |
| `limit`   | number | No       | Max results (default: 10) |

### get\_context

Get everything about a specific entity: its memories, relations, and attributes.

```json theme={null}
{
  "entity_name": "Acme Corp"
}
```

| Parameter     | Type   | Required | Description                   |
| ------------- | ------ | -------- | ----------------------------- |
| `entity_name` | string | Yes      | Name of the entity to look up |

### list\_entities

List all known entities in the graph, optionally filtered by type.

```json theme={null}
{
  "type": "Person"
}
```

| Parameter | Type   | Required | Description                                    |
| --------- | ------ | -------- | ---------------------------------------------- |
| `type`    | string | No       | Filter by entity type (see Entity Types below) |

### invalidate

Mark a memory as no longer valid. The memory is kept for history but excluded from `recall` results.

```json theme={null}
{
  "memory_id": "abc123",
  "reason": "Pricing has been updated for Q2"
}
```

| Parameter   | Type   | Required | Description                    |
| ----------- | ------ | -------- | ------------------------------ |
| `memory_id` | string | Yes      | ID of the memory to invalidate |
| `reason`    | string | No       | Why it's being invalidated     |

### relate

Create a directed relationship between two entities. Creates the entities automatically if they don't exist yet.

```json theme={null}
{
  "source": "John Doe",
  "target": "Acme Corp",
  "relation_type": "works_at"
}
```

| Parameter       | Type   | Required | Description                                     |
| --------------- | ------ | -------- | ----------------------------------------------- |
| `source`        | string | Yes      | Source entity name                              |
| `target`        | string | Yes      | Target entity name                              |
| `relation_type` | string | Yes      | Type of relationship (see Relation Types below) |

### switch\_agent

Switch to a different agent's context graph at runtime. All subsequent tool calls target the new agent's graph.

```json theme={null}
{
  "agent_id": "2c5eaa9d-5510-4a1d-a204-a795646eeb32"
}
```

| Parameter  | Type   | Required | Description               |
| ---------- | ------ | -------- | ------------------------- |
| `agent_id` | string | Yes      | The agent ID to switch to |

Returns the previous and new agent ID, plus a health check confirming the backend is reachable.

## Entity Types

| Type           | Description                    | Example                                |
| -------------- | ------------------------------ | -------------------------------------- |
| `Person`       | A person                       | John Doe, a client, an employee        |
| `Organization` | A company, team, or group      | Acme Corp, Engineering team            |
| `Product`      | A product or service           | Rippletide, Samsung TV RED43           |
| `Amount`       | A monetary amount or quantity  | \$50,000 budget, 100 users             |
| `Date`         | A date or time reference       | Q2 2025, next Monday                   |
| `Location`     | A physical or virtual location | Paris, staging environment             |
| `Concept`      | An abstract concept or topic   | Microservices, pricing strategy        |
| `Decision`     | A decision that was made       | "Use PostgreSQL for the project"       |
| `Action`       | An action taken or planned     | Deploy to production, schedule meeting |

## Relation Types

| Type             | Example                                |
| ---------------- | -------------------------------------- |
| `works_at`       | John **works at** Acme Corp            |
| `wants`          | Client **wants** premium support       |
| `has`            | Acme Corp **has** enterprise plan      |
| `is_a`           | Rippletide **is a** SaaS product       |
| `related_to`     | Pricing **related to** Q2 review       |
| `caused`         | Bug report **caused** hotfix release   |
| `approved`       | Manager **approved** budget increase   |
| `declined`       | Client **declined** renewal            |
| `lives_in`       | John **lives in** Paris                |
| `resulted_in`    | Meeting **resulted in** partnership    |
| `mentioned_with` | Product A **mentioned with** Product B |

## Resources (4, read-only)

Resources let the AI client read the full graph state. Unlike tools (which perform actions), resources are passive data the client can query at any time.

| URI                 | Description                           | Use case                                  |
| ------------------- | ------------------------------------- | ----------------------------------------- |
| `graph://entities`  | All entities in the graph             | See all known people, companies, products |
| `graph://memories`  | All active (non-invalidated) memories | Review what the assistant remembers       |
| `graph://relations` | All active relations                  | Understand how entities are connected     |
| `graph://stats`     | Graph statistics                      | Check entity count, memory count, etc.    |
