3ngram works as an MCP server for Claude Managed Agents with zero configuration changes on the 3ngram side. Your agents get structured memory types, semantic search, due-date tracking, and proactive follow-through that Anthropic’s built-in Memory Stores don’t offer.Documentation Index
Fetch the complete documentation index at: https://docs.3ngram.ai/llms.txt
Use this file to discover all available pages before exploring further.
What are Managed Agents?
Claude Managed Agents is a hosted agent runtime from Anthropic. You define an agent config (model, system prompt, tools), then start sessions where Anthropic runs the agent loop and provisions a sandboxed container for tool execution. Agents connect to external services like 3ngram via MCP servers.Prerequisites
- A 3ngram account with at least one memory saved
- An Anthropic API key with Managed Agents beta access
- The Anthropic SDK installed (
npm install @anthropic-ai/sdkorpip install anthropic)
Step 1: Complete the 3ngram OAuth flow
Before registering credentials with Anthropic, you need OAuth tokens from 3ngram. The easiest way is through any MCP client that supports OAuth:- Connect to
https://mcp.3ngram.ai/mcpfrom Claude Desktop, Claude Code, or Cursor (see Connecting Clients) - Complete the OAuth authorization in your browser
- Note your
access_token,refresh_token, andclient_idfrom the OAuth response
Step 2: Create a vault and store credentials
Vaults hold MCP credentials that Anthropic auto-refreshes on your behalf. Create one and register your 3ngram OAuth tokens:Step 3: Create an agent with 3ngram
Agents are persistent, versioned configs. Create one once, then reuse it across sessions:Don’t create a new agent every run. Store the agent ID and reuse it. To change behavior, update the existing agent with
client.beta.agents.update(agentId, { ... }) — each update creates a new version.Step 4: Start a session
Each session is one run of your agent. Reference the agent, environment, and vault:Tool permission policies
MCP tools default toalways_ask, which pauses the agent for human approval on every tool call. For autonomous operation, configure always_allow on safe tools.
The table below shows recommended policies based on each tool’s behavior:
Recommended: always_allow
These tools are safe for autonomous use. Read-only tools have no side effects;remember is scoped to memory persistence.
| Tool | Read-only | Why allow |
|---|---|---|
search | Yes | Canonical search across memories + content, no side effects |
get_prompt | Yes | Reads prompt template |
get_schedule_history | Yes | Reads schedule history |
get_trigger_history | Yes | Reads trigger history |
export_doc | Yes | Exports Google Doc as text |
remember | No | Core memory persistence |
set_preference | No | Stores user/project settings |
configure_scope | No | Maps project to scope |
propose_action | No | Externalizes decisions for approval |
Recommended: always_ask
These tools create, update, or delete resources. Require human approval to prevent unintended changes.| Tool | Destructive | Why ask |
|---|---|---|
update_memories | Yes | Bulk-changes memory type/status, including archiving |
set_memory_sharing | Yes | Can revoke previously granted memory access |
delete_prompt | Yes | Removes prompt template |
delete_schedule | Yes | Removes scheduled run |
delete_trigger | Yes | Removes trigger |
create_schedule | No | Creates recurring agent runs |
create_trigger | No | Creates event listeners |
create_prompt | No | Creates prompt template |
update_prompt | No | Modifies existing prompt |
update_schedule | No | Modifies schedule config |
update_trigger | No | Modifies trigger config |
create_doc | No | Creates Google Doc (external) |
resolve | Yes | Marks commitments complete and can trigger sync side effects |
unresolve | No | Reopens resolved items |
reindex | Yes | Full reindex prunes orphan content_chunks for files no longer present |
sync_source | No | Triggers source re-sync |
reapply_scope_mappings | No | Bulk scope updates |
mcp_toolset default at always_ask and explicitly allow only the safe autonomous tools. This fail-closed default ensures unlisted or newly-added tools still require human approval:
Multi-agent pattern
Managed Agents support multi-agent sessions where a coordinator delegates to specialists. All agents in a session authenticate as the same user (via the shared vault), so they share the same 3ngram memory namespace. Pattern: The coordinator reads commitments for overall status and delegates tasks. Specialists useremember to persist findings and search to access shared context. All agents see the same memory pool.
Use project tags and scopes for finer isolation between agents or workstreams within the shared namespace.
See multi-agent-coordinator.json for a complete example config.
System prompt examples
Session startup
During work
Session end
Troubleshooting
Token refresh fails
Anthropic auto-refreshes tokens using therefresh.token_endpoint stored in your vault credential. If refresh fails:
- Verify
token_endpointishttps://mcp.3ngram.ai/mcp/oauth/token - Ensure the original refresh token hasn’t expired (30-day TTL — the access token has a 1-hour TTL and is rotated automatically)
- Re-authorize via any MCP client and update the vault credential
Tools not discovered
- Confirm the MCP server URL is exactly
https://mcp.3ngram.ai/mcp - Check that
mcp_toolsetintoolsreferences the correctmcp_server_name - Verify the vault credential’s
mcp_server_urlmatches the agent’smcp_servers[].url
MCP resources not accessible
Managed Agents cannot read MCP resources (likeengram://commitments) directly. Use the briefing tool to fan all four accountability views into one call, or fall back to scoped search(source_type="memory", memory_type=...) calls:
briefing(project=...)returns commitments, blockers, overdue, and stale in one structured payloadsearch(source_type="memory", memory_type="commitment", status="open")for open commitments onlysearch(source_type="memory", memory_type="blocker", status="open")for active blockerssearch(source_type="memory", memory_type="commitment", status="open", due_before=<today>)for past-due items
Rate limits
3ngram’s rate limiter is tuned for interactive use. Long-running agent sessions with many tool calls may hit per-tool cooldowns. If you see rate limit errors, space out tool calls or contact support for higher limits.Budget limits
3ngram tracks LLM-cost spend per user viauser_budgets (default budget is provisioned on activation). Any tool call that invokes an LLM internally draws from this budget — including embedding-backed tools like remember and search, and scheduled agent runs that issue model calls. Active subscriptions also gate access to MCP tools via require_subscription. If you see “LLM budget exceeded” errors during managed-agent runs, check usage and current plan on the dashboard.
What’s next
- Connecting other AI clients — use 3ngram with Claude Desktop, Cursor, and ChatGPT
- Memory tools reference — full guide to all memory operations
- MCP prompts — briefing, debrief, and other prompt templates
- Actions — how propose_action works for approval gates