CAMI Documentation

MCP Tools API Reference

CAMI provides 19 Model Context Protocol (MCP) tools that enable Claude Code to manage agents dynamically through natural language conversation. This is CAMI's primary interface - you talk to Claude naturally, and Claude uses these tools behind the scenes to accomplish your goals.

Understanding MCP Tools

MCP tools are like API endpoints, but designed for AI assistants. When you tell Claude "deploy the frontend agent to my project," Claude translates your intent into precise tool calls with the correct parameters.

You interact naturally:

text
"Deploy frontend and backend agents to ~/projects/my-app"

Claude uses tools:

typescript
mcp__cami__deploy_agents({
agent_names: ["frontend", "backend"],
target_path: "/Users/you/projects/my-app",
overwrite: false
})

Key Benefits:

  • Natural language interface - no memorizing commands
  • Context-aware - Claude understands your project structure
  • Error handling - Claude interprets errors and suggests fixes
  • Workflow automation - Claude chains multiple tools together

Tool Categories

CAMI's 19 tools are organized into four categories:

Agent Management (5 tools)

Core operations for discovering and deploying agents:

  • list_agents - Discover available agents from all sources
  • deploy_agents - Copy agents to project directories
  • scan_deployed_agents - Audit deployed agents and check for updates
  • update_claude_md - Document deployed agents in CLAUDE.md
  • import_agents - Bring externally-deployed agents into CAMI tracking

Source Management (5 tools)

Manage Git repositories of agent libraries:

  • add_source - Clone and register agent repositories
  • list_sources - View configured sources with compliance status
  • update_source - Pull latest agents from Git
  • source_status - Check Git status of sources
  • detect_source_state - Analyze source compliance
  • normalize_source - Fix compliance issues automatically

Project Management (4 tools)

Manage deployment locations and project setup:

  • add_location - Register project directories
  • list_locations - View saved project locations
  • remove_location - Unregister projects
  • create_project - Initialize new projects with agents

Normalization & Utility (5 tools)

Advanced features for migration and maintenance:

  • detect_project_state - Analyze project normalization state
  • normalize_project - Migrate projects to CAMI standards
  • cleanup_backups - Remove old backup directories
  • onboard - Get personalized setup guidance

Agent Management Tools

list_agents

Purpose: Discover all available agents across configured sources.

When to Use:

  • Before deploying agents (to see what's available)
  • Exploring available specialists for a task
  • Verifying sources loaded correctly

Parameters: None

Returns:

typescript
{
agents: Array<{
name: string; // Agent identifier(e.g., "frontend")
version: string; // Semantic version(e.g., "2.1.0")
description: string; // One-line purpose description
category: string; // Folder organization(e.g., "core")
file_name: string; // Source filename(e.g., "frontend.md")
}>;
}

Natural Language Examples:

text
"What agents are available?"
"Show me all agents in the core category"
"List frontend-related agents"

Response Format:

text
Available agents (12 total):
## Core (3 agents)
• architect (v3.2.0)
Expert application architect specializing in system design
• backend (v2.1.0)
Back-end specialist for Node.js and API development
• frontend (v2.0.1)
Front-end specialist for React and modern web UIs
## Specialized (2 agents)
• designer (v1.1.0)
Visual design and UI/UX specialist
• qa (v1.0.0)
Quality assurance and testing specialist

Priority-Based Deduplication:

If multiple sources contain agents with the same name, CAMI uses the agent from the source with the lowest priority number (1 = highest priority):

yaml
agent_sources:
- name: my-agents # Priority 10 (highest)
- name: team-agents # Priority 50 (medium)
- name: official-agents # Priority 100 (lowest)

If "frontend" exists in all three sources, the version from my-agents is used.

Error Conditions:

  • No sources configured: Returns error with setup instructions
  • Sources exist but no agents found: Returns empty list with warning
  • Invalid source paths: Logs warnings, continues with valid sources

See Also:


deploy_agents

Purpose: Copy selected agents from sources to a project's .claude/agents/ directory.

When to Use:

  • Adding agents to an existing project
  • Setting up a new project with specialists
  • Updating agents to newer versions (with overwrite)

Parameters:

typescript
{
agent_names: string[]; // Required: Agent names to deploy
target_path: string; // Required: Absolute project path
overwrite?: boolean; // Optional: Replace existing(default: false)
}

Returns:

typescript
{
results: Array<{
agent_name: string; // Agent that was deployed
success: boolean; // Whether deployment succeeded
message: string; // Human-readable result message
conflict?: boolean; // True if file exists and overwrite=false
}>;
}

Natural Language Examples:

text
"Deploy frontend and backend agents to ~/projects/my-app"
"Add the designer agent to this project"
"Update the architect agent to the latest version"

Underlying Tool Call:

typescript
mcp__cami__deploy_agents({
agent_names: ["frontend", "backend"],
target_path: "/Users/you/projects/my-app",
overwrite: false
})

Response Example:

text
Deployed 2 agents to /Users/you/projects/my-app
✓ frontend: Deployed successfully
✓ backend: Deployed successfully

Deployment Behavior:

  1. Validates target path - Ensures directory exists
  2. Creates .claude/agents/ - If it doesn't exist
  3. Copies agent files - From source to target
  4. Checks for conflicts - If overwrite=false and file exists
  5. Updates manifests - Tracks deployment in project and central manifests
  6. Calculates hashes - For change detection

Conflict Handling:

When overwrite=false (default) and an agent already exists:

text
✗ frontend: File already exists (use overwrite=true to replace)

When overwrite=true:

text
✓ frontend: Deployed successfully (overwrote existing)

Manifest Updates:

After deployment, CAMI updates two manifests:

Project Manifest (.claude/.cami/manifest.yaml):

yaml
version: "1"
state: cami-native
normalized_at: 2025-11-24T10:30:00Z
agents:
- name: frontend
version: "2.0.1"
source: official-agents
source_path: /Users/you/cami-workspace/sources/official-agents/frontend.md
priority: 50
deployed_at: 2025-11-24T10:30:00Z
content_hash: abc123...
metadata_hash: def456...
origin: cami

Central Manifest (~/cami-workspace/central-manifest.yaml):

yaml
deployments:
/Users/you/projects/my-app:
state: cami-native
normalized_at: 2025-11-24T10:30:00Z
last_scanned: 2025-11-24T10:30:00Z
agents:
- name: frontend
version: "2.0.1"
# ... same fields as project manifest

Error Conditions:

  • Target path doesn't exist: Error with path validation message
  • Agent not found: Lists missing agents by name
  • Deployment fails: Returns partial results (some succeed, some fail)
  • Manifest update fails: Logs warning, deployment still succeeds

Performance Notes:

  • Copies files, doesn't symlink (enables version control)
  • Fast for typical deployments (1-10 agents in <1 second)
  • Hash calculation adds minimal overhead (<10ms per agent)

See Also:


scan_deployed_agents

Purpose: Audit a project directory to discover deployed agents and compare versions with available sources.

When to Use:

  • Before updating agents (to see what's deployed)
  • Auditing unknown projects
  • Checking if deployed agents have updates available

Parameters:

typescript
{
target_path: string; // Required: Absolute path to project
}

Returns:

typescript
{
statuses: Array<{
name: string; // Agent name
deployed_version: string; // Version in project(empty if not deployed)
available_version: string; // Latest version in sources
status: string; // "up-to-date" | "update-available" | "not-deployed"
}>;
}

Natural Language Examples:

text
"What agents are deployed in this project?"
"Check if my agents need updating"
"Scan ~/projects/my-app for deployed agents"

Response Example:

text
Scanning /Users/you/projects/my-app
Found 3 deployed agents
✓ frontend: up-to-date (deployed: v2.0.1, available: v2.0.1)
⚠ backend: update-available (deployed: v1.5.0, available: v2.1.0)
○ designer: not-deployed

Status Indicators:

  • up-to-date: Deployed version matches source version
  • update-available: Newer version exists in sources
  • not-deployed: Agent available but not deployed

Scan Algorithm:

  1. Find .claude/agents/: Returns empty if directory doesn't exist
  2. Parse agent files: Read frontmatter from each .md file
  3. Load available agents: From all configured sources
  4. Compare versions: String comparison (exact match required)
  5. Return status: For every available agent, not just deployed

Version Comparison:

CAMI uses exact string matching for version comparison:

  • "2.0.1" == "2.0.1" - up-to-date
  • "2.0.1" != "2.1.0" - update-available
  • No semantic versioning logic (2.0.1 vs 2.1.0 both treated as different)

Edge Cases:

  • Agent in project but not in sources: Not included in results
  • Malformed agent files: Skipped with warning logged to stderr
  • No .claude/agents/ directory: Returns empty list (not an error)

See Also:


update_claude_md

Purpose: Update a project's CLAUDE.md file with documentation about deployed agents.

When to Use:

  • After deploying agents (to document them)
  • Updating project documentation
  • Onboarding new team members (they see agent info in CLAUDE.md)

Parameters:

typescript
{
target_path: string; // Required: Absolute path to project
}

Returns: Text confirmation with list of documented agents

Natural Language Examples:

text
"Update CLAUDE.md with deployed agents"
"Document the agents in this project"
"Refresh the agent documentation"

Response Example:

text
Updated CLAUDE.md at /Users/you/projects/my-app
Documented 3 agents:
• frontend (v2.0.1)
• backend (v2.1.0)
• designer (v1.1.0)

What Gets Updated:

The tool inserts or updates a CAMI-managed section in CLAUDE.md:

markdown
<!-- CAMI-MANAGED: DEPLOYED-AGENTS | Last Updated: 2025-11-24T10:30:00Z -->
## Deployed Agents
The following Claude Code agents are available in this project:
### frontend (v2.0.1)
Front-end specialist for React and modern web UIs with TypeScript expertise.
### backend (v2.1.0)
Back-end specialist for Node.js API development with database integration.
### designer (v1.1.0)
Visual design and UI/UX specialist ensuring aesthetic excellence.
<!-- /CAMI-MANAGED: DEPLOYED-AGENTS -->

CAMI-Managed Sections:

CAMI uses special HTML comments to mark managed content:

html
<!-- CAMI-MANAGED: SECTION-NAME | Last Updated: timestamp -->
... managed content ...
<!-- /CAMI-MANAGED: SECTION-NAME -->

Behavior:

  • Creates CLAUDE.md if it doesn't exist
  • Preserves user content outside managed sections
  • Updates timestamp on each run
  • Safe to run multiple times (idempotent)

File Creation:

If CLAUDE.md doesn't exist, CAMI creates it with:

markdown
# CLAUDE.md
Project documentation for Claude Code.
<!-- CAMI-MANAGED: DEPLOYED-AGENTS | ... -->
...
<!-- /CAMI-MANAGED: DEPLOYED-AGENTS -->

Error Conditions:

  • Target path doesn't exist: Returns error
  • No agents deployed: Creates empty section with helpful message
  • CLAUDE.md read error: Returns error with file path

See Also:


import_agents

Purpose: Import and track agents that were deployed outside of CAMI (manual copy, other tools, etc.).

When to Use:

  • You have existing .claude/agents/ from manual deployment
  • Migrating from another agent management system
  • Bringing pre-CAMI projects into CAMI tracking

Parameters:

typescript
{
project_path: string; // Required: Absolute path to project
dry_run?: boolean; // Optional: Preview without changes(default: false)
}

Returns:

typescript
{
project_path: string;
agents_found: number;
agents_imported: number; // 0 if dry_run=true
agents: Array<{
name: string;
version: string;
file_path: string;
origin: string; // "cami" | "external"
source_match: string; // Source name if matched, empty otherwise
content_hash: string;
metadata_hash: string;
}>;
dry_run: boolean;
}

Natural Language Examples:

text
"Import agents from ~/projects/legacy-app"
"Preview what would be imported from this project"
"Bring existing agents into CAMI tracking"

Dry Run Example:

typescript
mcp__cami__import_agents({
project_path: "/Users/you/projects/legacy-app",
dry_run: true
})

Response (dry run):

text
# Import Agents: /Users/you/projects/legacy-app
**Agents Found:** 5
## Matched to CAMI Sources
- **frontend** (v2.0.1) - Source: `official-agents`
- **backend** (v2.1.0) - Source: `official-agents`
## External Agents (No Source Match)
- **custom-agent** (v1.0.0)
- **legacy-helper** (no version)
- **temp-script** (v0.1.0)
---
**This is a dry run - no changes were made.**
To import these agents, call this tool again with `dry_run=false`.

Actual Import Example:

typescript
mcp__cami__import_agents({
project_path: "/Users/you/projects/legacy-app",
dry_run: false
})

Response (actual import):

text
# Import Agents: /Users/you/projects/legacy-app
**Agents Found:** 5
## Matched to CAMI Sources
- **frontend** (v2.0.1) - Source: `official-agents`
- **backend** (v2.1.0) - Source: `official-agents`
## External Agents (No Source Match)
- **custom-agent** (v1.0.0)
- **legacy-helper** (no version)
---
Import Complete!
- Imported 5 agents
- 2 matched to sources
- 3 external agents
- Created project manifest
- Updated central deployment tracking
These agents are now tracked by CAMI for version management and updates!

Import Algorithm:

  1. Scan .claude/agents/: Read all .md files
  2. Parse frontmatter: Extract name, version, description
  3. Calculate hashes: Content hash and metadata hash
  4. Match to sources: Compare name + content hash with available agents
  5. Classify origin:
    • origin: "cami" - Exact match to source (name + content hash)
    • origin: "external" - No match found
  6. Create manifests: Project and central manifests
  7. Enable tracking: Agents now visible to scan_deployed_agents

Source Matching Logic:

go
// Pseudo-code for matching
for each deployed_agent:
for each available_agent in sources:
if deployed_agent.name == available_agent.name:
deployed_hash = hash(deployed_agent.content)
source_hash = hash(available_agent.content)
if deployed_hash == source_hash:
// Exact match - originated from this source
origin = "cami"
source_match = source.name
break

Benefits of Importing:

Before import:

  • Agents exist but CAMI doesn't know about them
  • No update detection
  • No version tracking
  • No source attribution

After import:

  • Full CAMI tracking enabled
  • Update detection works
  • Version comparison available
  • Source attribution (if matched)

Error Conditions:

  • No .claude/agents/ directory: Error message
  • Malformed agent files: Skipped with warning
  • Manifest write fails: Error (import cancelled)

See Also:


Source Management Tools

add_source

Purpose: Clone a Git repository of agents and register it as a CAMI source.

When to Use:

  • Adding official agent libraries
  • Integrating team/company agent repositories
  • Setting up CAMI for the first time

Parameters:

typescript
{
url: string; // Required: Git URL(HTTPS or SSH)
name?: string; // Optional: Source name(derived from URL if omitted)
priority?: number; // Optional: Priority(default: 50)
}

Returns: Text confirmation with clone location and agent count

Natural Language Examples:

text
"Add agent source from git@github.com:company/agents.git"
"Clone the official agents library"
"Add team agents with priority 10"

Underlying Tool Call:

typescript
mcp__cami__add_source({
url: "git@github.com:company/agents.git",
name: "company-agents", // Optional
priority: 50 // Optional
})

Response Example:

text
✓ Cloned company-agents to ~/cami-workspace/sources/company-agents
✓ Added source with priority 50
✓ Found 12 agents
## Source Compliance Check
✓ **Source is fully compliant!**

Or if issues detected:

text
✓ Cloned team-agents to ~/cami-workspace/sources/team-agents
✓ Added source with priority 50
✓ Found 8 agents
## Source Compliance Check
This source has compliance issues:
- Missing .camiignore file
- 3 agents with issues:
- old-agent.md: missing version, missing description
- legacy.md: missing version
**Recommendation:** Use `normalize_source` to fix these issues automatically.
This will add missing versions, descriptions, and create .camiignore.

Name Derivation:

If name is not provided, CAMI derives it from the URL:

text
git@github.com:company/agents.git → "agents"
https://github.com/lando/official-agents.git → "official-agents"
git@gitlab.com:team/custom.git → "custom"

Priority System:

Lower numbers = higher priority (1 = highest, 100 = lowest):

  • 1-10: Personal overrides
  • 20-40: Team standards
  • 50: Default for new sources
  • 60-80: Third-party libraries
  • 100+: Low-priority/experimental

Clone Location:

Sources are cloned to:

text
~/cami-workspace/sources/<name>/

Or if CAMI_DIR is set:

text
$CAMI_DIR/sources/<name>/

Config Update:

Adds entry to ~/cami-workspace/config.yaml:

yaml
agent_sources:
- name: company-agents
type: local
path: /Users/you/cami-workspace/sources/company-agents
priority: 50
git:
enabled: true
remote: git@github.com:company/agents.git

Automatic Compliance Detection:

After cloning, CAMI automatically analyzes the source for compliance issues:

  • Missing .camiignore file
  • Agents without version field
  • Agents without description field

If issues found, CAMI suggests using normalize_source to fix them.

Error Conditions:

  • Source name already exists: Error (use different name)
  • Git clone fails: Error with git output
  • Target directory exists: Error (prevents accidental overwrite)
  • Invalid URL: Error from git clone

See Also:


list_sources

Purpose: View all configured agent sources with compliance status and Git information.

When to Use:

  • Checking what sources are configured
  • Verifying source priorities
  • Auditing source compliance

Parameters: None

Returns:

typescript
{
sources: Array<{
name: string;
path: string;
priority: number;
agent_count: number;
git_remote?: string; // Present if git enabled
git_enabled: boolean;
is_compliant: boolean; // True if passes compliance checks
issue_count?: number; // Number of compliance issues
issues_summary?: string; // Summary of issues
}>;
}

Natural Language Examples:

text
"What agent sources are configured?"
"Show me all sources with their priorities"
"List sources that need updates"

Response Example:

text
Agent Sources (3 total):
• ✓ official-agents (priority 50)
Path: /Users/you/cami-workspace/sources/official-agents
Agents: 15
Git: git@github.com:lando/official-agents.git
Compliance: ✓ Compliant
• ⚠️ team-agents (priority 30)
Path: /Users/you/cami-workspace/sources/team-agents
Agents: 8
Git: git@github.com:company/team-agents.git
Compliance: ⚠️ Issues (3 agents with issues)
• ✓ my-agents (priority 10)
Path: /Users/you/cami-workspace/sources/my-agents
Agents: 2
Compliance: ✓ Compliant
**Note:** 1/3 sources have compliance issues.
Use `detect_source_state` and `normalize_source` to fix issues.

Compliance Checks:

A source is compliant if:

  • Has .camiignore file (recommended)
  • All agents have version field
  • All agents have description field

Priority Display:

Sources are listed in config order (not sorted by priority). To see effective priority for duplicate agents, use list_agents which applies priority-based deduplication.

Error Conditions:

  • No config found: Error with setup instructions
  • Config exists but no sources: Helpful message with add_source command

See Also:


update_source

Purpose: Pull latest changes from Git for agent sources (runs git pull).

When to Use:

  • Updating to latest agent versions
  • Pulling team changes to shared sources
  • Regular maintenance (weekly/monthly)

Parameters:

typescript
{
name?: string; // Optional: Specific source name(updates all if omitted)
}

Returns: Text summary of update results

Natural Language Examples:

text
"Update all agent sources"
"Pull latest changes for official-agents"
"Update the team-agents source"

Update All Sources:

typescript
mcp__cami__update_source({})

Response:

text
Updating official-agents...
✓ Updated
Updating team-agents...
✓ Up to date
Updating my-agents...
Updated: official-agents
Skipped (no git remote): my-agents

Update Specific Source:

typescript
mcp__cami__update_source({
name: "official-agents"
})

Response:

text
Updating official-agents...
✓ Updated
Updated: official-agents

Update Logic:

For each source:

  1. Check git enabled: Skip if git.enabled = false
  2. Run git pull: In source directory
  3. Check output: Detect "Already up to date" message
  4. Report status: Updated or already up-to-date

Git Configuration Required:

Only sources with Git configuration are updated:

yaml
agent_sources:
- name: official-agents
git:
enabled: true
remote: git@github.com:lando/agents.git

Error Handling:

  • Git pull fails: Logs error, continues with next source
  • Source not found: Error if specific name provided
  • No git remote: Skips source, reports in summary

After Updating:

Agent changes take effect immediately:

  • list_agents shows new versions
  • deploy_agents uses updated content
  • scan_deployed_agents detects available updates

See Also:


source_status

Purpose: Show Git working tree status for agent sources (uncommitted changes).

When to Use:

  • Before updating sources (to avoid losing changes)
  • Checking if you've modified source agents
  • Auditing source cleanliness

Parameters: None

Returns: Text output showing git status for each source

Natural Language Examples:

text
"Check git status of agent sources"
"Do I have uncommitted changes in my sources?"
"Show source status"

Response Example:

text
Agent Source Status:
• official-agents
Git: ✓ clean
• team-agents
Git: ⚠ 3 uncommitted changes
M frontend.md
M backend.md
?? new-agent.md
... and 0 more
• my-agents
Git: not enabled

Status Indicators:

  • clean: No uncommitted changes (safe to update)
  • N uncommitted changes: Modified/added files (review before updating)
  • not enabled: Source has no Git configuration

Displayed Changes:

Shows up to 3 changed files using git's short format:

  • M file.md - Modified
  • A file.md - Added
  • D file.md - Deleted
  • ?? file.md - Untracked

Use Case - Before Updating:

text
You: "Update all sources"
Claude: "Let me check for uncommitted changes first..."
[Runs source_status]
Claude: "I see you have uncommitted changes in team-agents.
Would you like to commit them before updating?"

Error Conditions:

  • Git command fails: Shows error for that source, continues with others
  • Source path invalid: Shows error for that source

See Also:


detect_source_state

Purpose: Analyze an agent source for CAMI compliance issues.

When to Use:

  • After adding a new source
  • Before deploying from a source
  • Auditing source quality

Parameters:

typescript
{
source_name: string; // Required: Name of source to analyze
}

Returns:

typescript
{
path: string;
agent_count: number;
is_compliant: boolean;
missing_camiignore: boolean;
issues: Array<{
agent_file: string;
problems: string[]; // e.g., ["missing version", "missing description"]
}>;
}

Natural Language Examples:

text
"Check compliance of team-agents source"
"Analyze official-agents for issues"
"Is my-agents source compliant?"

Response Example (compliant):

text
# Source Analysis: official-agents
**Path:** /Users/you/cami-workspace/sources/official-agents
**Agent Count:** 15
**Compliant:** true
✓ **All agents are compliant!**

Response Example (issues found):

text
# Source Analysis: team-agents
**Path:** /Users/you/cami-workspace/sources/team-agents
**Agent Count:** 8
**Compliant:** false
Missing .camiignore file
## Issues Found (3)
**legacy-agent.md:**
- missing version
- missing description
**old-helper.md:**
- missing version
**temp-script.md:**
- missing description
## Recommended Action
Use `normalize_source` to fix these issues automatically.

Compliance Requirements:

For a source to be compliant:

  1. Has .camiignore file (optional but recommended)
  2. All agents have version: version: "X.Y.Z" in frontmatter
  3. All agents have description: description: "..." in frontmatter

Common Issues:

  • missing version: No version field in YAML frontmatter
  • missing description: No description field in YAML frontmatter
  • Missing .camiignore: No .camiignore file in source root

Why Compliance Matters:

Non-compliant agents can still be deployed, but:

  • No version tracking (can't detect updates)
  • Poor documentation (unclear purpose)
  • Includes non-agent files (README.md, LICENSE, etc.)

Error Conditions:

  • Source not found: Error with available source names
  • Analysis fails: Error with details

See Also:


normalize_source

Purpose: Automatically fix compliance issues in an agent source.

When to Use:

  • After detect_source_state reports issues
  • Preparing a source for team use
  • Migrating legacy agents to CAMI standards

Parameters:

typescript
{
source_name: string; // Required: Source to normalize
add_versions: boolean; // Add "1.0.0" to agents missing version
add_descriptions: boolean; // Add placeholder descriptions
create_camiignore: boolean; // Create .camiignore file
}

Returns:

typescript
{
success: boolean;
agents_updated: number;
backup_path: string; // Where backup was created
changes: string[]; // List of changes made
}

Natural Language Examples:

text
"Normalize team-agents source"
"Fix compliance issues in my-agents"
"Add missing versions to legacy-agents"

Full Normalization:

typescript
mcp__cami__normalize_source({
source_name: "team-agents",
add_versions: true,
add_descriptions: true,
create_camiignore: true
})

Response:

text
# Source Normalization: team-agents
**Status:** ✓ Success
**Agents Updated:** 3
**Backup Created:** /Users/you/cami-workspace/sources/.backups/team-agents-20251124-103045
## Changes Made
- Added version "1.0.0" to legacy-agent.md
- Added version "1.0.0" to old-helper.md
- Added description to temp-script.md
- Created .camiignore file

Selective Normalization:

typescript
// Only add versions, don't touch descriptions
mcp__cami__normalize_source({
source_name: "team-agents",
add_versions: true,
add_descriptions: false,
create_camiignore: false
})

Backup Before Changes:

CAMI always creates a timestamped backup before normalization:

text
~/cami-workspace/sources/.backups/
team-agents-20251124-103045/
frontend.md
backend.md
legacy-agent.md
...

Version Addition:

When add_versions: true, CAMI adds version: "1.0.0" to frontmatter:

Before:

yaml
---
name: legacy-agent
description: Helper for legacy systems
---

After:

yaml
---
name: legacy-agent
version: "1.0.0"
description: Helper for legacy systems
---

Description Addition:

When add_descriptions: true, CAMI adds placeholder based on name:

Before:

yaml
---
name: api-helper
version: "1.0.0"
---

After:

yaml
---
name: api-helper
version: "1.0.0"
description: Agent for api-helper tasks (update this description)
---

Note: Placeholder descriptions should be updated manually with accurate information.

.camiignore Creation:

When create_camiignore: true, CAMI creates a standard .camiignore file:

gitignore
# Documentation files
README.md
LICENSE.md
LICENSE
CHANGELOG.md
# Drafts and work in progress
*-draft.md
*-wip.md
*.draft
*.wip
# Templates and examples
templates/
examples/
*.template
# Hidden files
.git/
.github/
.DS_Store
# Config files
*.json
*.yaml
*.yml

Undo Normalization:

If normalization goes wrong, restore from backup:

bash
# Manual undo
cp -r ~/cami-workspace/sources/.backups/team-agents-20251124-103045/* \
~/cami-workspace/sources/team-agents/

Error Conditions:

  • Source not found: Error with available source names
  • Backup creation fails: Error (normalization cancelled)
  • File write fails: Error with details

See Also:


Project Management Tools

add_location

Purpose: Register a project directory as a deployment location for quick reference.

When to Use:

  • Adding frequently-used projects to quick access
  • Organizing multiple project workspaces
  • Setting up team's project list

Parameters:

typescript
{
name: string; // Required: Friendly location name
path: string; // Required: Absolute path to project
}

Returns: Text confirmation

Natural Language Examples:

text
"Add my-app as a deployment location at ~/projects/my-app"
"Register this project directory"
"Save ~/projects/api-backend as 'api-backend'"

Underlying Tool Call:

typescript
mcp__cami__add_location({
name: "my-app",
path: "/Users/you/projects/my-app"
})

Response:

text
Added location 'my-app' at /Users/you/projects/my-app
Total locations: 3

Config Update:

Adds entry to ~/cami-workspace/config.yaml:

yaml
deploy_locations:
- name: my-app
path: /Users/you/projects/my-app
- name: api-backend
path: /Users/you/projects/api-backend

Benefits of Locations:

Without locations:

text
"Deploy frontend to /Users/you/projects/my-long-project-name-here"

With locations:

text
"Deploy frontend to my-app" # Claude looks up path

Validation:

  • Name uniqueness: Can't add duplicate names
  • Path uniqueness: Can't add duplicate paths
  • Path exists: Must be valid existing directory
  • Absolute path: Relative paths rejected

Error Conditions:

  • Name already exists: Error message
  • Path already registered: Error message
  • Path doesn't exist: Error with path
  • Not a directory: Error message

See Also:


list_locations

Purpose: View all registered deployment locations.

When to Use:

  • Seeing what projects are registered
  • Finding a project path by name
  • Auditing saved locations

Parameters: None

Returns:

typescript
{
locations: Array<{
name: string;
path: string;
}>;
}

Natural Language Examples:

text
"What locations are configured?"
"Show me saved project directories"
"List deployment locations"

Response Example:

text
Configured locations (3 total):
• my-app
/Users/you/projects/my-app
• api-backend
/Users/you/projects/api-backend
• landing-page
/Users/you/projects/landing-page

Empty State:

text
Configured locations (0 total):
No locations configured yet. Use add_location to register a project directory.

Use in Deployment:

Claude can use location names instead of full paths:

text
You: "Deploy frontend to my-app"
Claude: [Looks up "my-app" → /Users/you/projects/my-app]
[Calls deploy_agents with full path]

Error Conditions: None (always succeeds, returns empty list if no locations)

See Also:


remove_location

Purpose: Unregister a deployment location from CAMI configuration.

When to Use:

  • Removing projects you no longer work on
  • Cleaning up old/deleted projects
  • Reorganizing location list

Parameters:

typescript
{
name: string; // Required: Location name to remove
}

Returns: Text confirmation

Natural Language Examples:

text
"Remove the my-app location"
"Unregister api-backend"
"Delete the landing-page location"

Underlying Tool Call:

typescript
mcp__cami__remove_location({
name: "my-app"
})

Response:

text
Removed location 'my-app'
Remaining locations: 2

Important Notes:

  • Only removes from config - doesn't delete project directory
  • No impact on deployments - agents remain deployed in project
  • Reversible - just add_location again to re-register

Error Conditions:

  • Location not found: Error with available location names
  • Name is empty: Error message

See Also:


create_project

Purpose: Create a new project with proper setup - directory structure, CLAUDE.md, and deployed agents.

When to Use:

  • Starting a new project from scratch
  • Setting up a project with recommended agents
  • Creating a project with vision documentation

Parameters:

typescript
{
name: string; // Required: Project name(kebab-case for directory)
path?: string; // Optional: Directory path(defaults to ~/projects/{name})
description: string; // Required: High-level project description(2-3 paragraphs)
agent_names: string[]; // Required: Agents to deploy
vision_doc?: string; // Optional: CLAUDE.md content(vision, not implementation)
}

Returns:

typescript
{
project_path: string; // Where project was created
agents_deployed: string[]; // Successfully deployed agent names
success: boolean;
}

Natural Language Examples:

text
"Create a new project called my-api-backend"
"Start a new React app with frontend and designer agents"
"Set up a project for building a dashboard"

Recommended Workflow:

CAMI's tool description specifies a workflow that Claude should follow:

  1. Gather Requirements (AskUserQuestion):
    • Project name
    • Description (what it does, why it exists)
    • Tech stack (React, Node.js, Python, etc.)
    • Key features
  2. Review Available Agents (list_agents):
    • See what specialists exist
  3. Recommend Agents:
    • Based on tech stack and features
    • Get user confirmation
  4. Create Missing Agents (if needed):
    • Invoke agent-architect to create specialists
    • Can create multiple agents in parallel
  5. Write Vision Doc:
    • 200-300 words focused on vision
    • What the project does and why
    • NOT implementation details
  6. Create Project (this tool):
    • With confirmed name, description, agents, vision
  7. Confirm Success:
    • Show project path
    • Guide to next steps

Example Interaction:

text
You: "Create a new project"
Claude: "I'll help you create a new project. Let me gather some information..."
[Uses AskUserQuestion to gather requirements]
You: [Provides: "api-backend", "REST API for mobile app", "Node.js + PostgreSQL"]
Claude: "Let me see what agents are available..."
[Calls list_agents]
Claude: "I recommend these agents for your Node.js API project:
- backend (v2.1.0) - API development specialist
- database (v1.5.0) - Database design expert
- qa (v1.0.0) - Testing specialist
Does this look good?"
You: "Yes, looks great"
Claude: [Creates project with create_project tool]
Project Created Successfully!
**Project**: api-backend
**Location**: /Users/you/projects/api-backend
**Agents Deployed**: 3
**Deployed Agents:**
- backend
- database
- qa
**Next Steps:**
1. Navigate to project: `cd /Users/you/projects/api-backend`
2. Review CLAUDE.md for project vision
3. Start building with your specialized agents!

Project Structure Created:

text
~/projects/api-backend/
├── .claude/
│ ├── agents/
│ │ ├── backend.md
│ │ ├── database.md
│ │ └── qa.md
│ └── .cami/
│ └── manifest.yaml
└── CLAUDE.md

CLAUDE.md Contents:

If vision_doc is provided, that content is written. Otherwise, a minimal CLAUDE.md is created. Either way, the deployed agents section is added:

markdown
# api-backend
[Vision doc content if provided...]
<!-- CAMI-MANAGED: DEPLOYED-AGENTS | Last Updated: 2025-11-24T10:30:00Z -->
## Deployed Agents
### backend (v2.1.0)
Back-end specialist for Node.js API development with database integration.
### database (v1.5.0)
Database design expert for PostgreSQL and data modeling.
### qa (v1.0.0)
Quality assurance and testing specialist.
<!-- /CAMI-MANAGED: DEPLOYED-AGENTS -->

Location Registration:

The project is automatically added to locations:

yaml
deploy_locations:
- name: api-backend
path: /Users/you/projects/api-backend

Error Conditions:

  • Project directory already exists: Error (prevents accidental overwrite)
  • Agents not found: Error with list of missing agents
  • Directory creation fails: Error with details

See Also:


Normalization & Utility Tools

detect_project_state

Purpose: Analyze a project's agent deployment state and normalization level.

When to Use:

  • Auditing unknown projects
  • Before normalizing a project
  • Understanding project's CAMI integration level

Parameters:

typescript
{
project_path: string; // Required: Absolute path to project
}

Returns:

typescript
{
path: string;
state: string; // Project state classification
has_agents_dir: boolean; // Has .claude/agents/
has_manifest: boolean; // Has .claude/.cami/manifest.yaml
agent_count: number;
agents: Array<{
name: string;
version: string;
matches_source: string; // Source name if matched
needs_upgrade: boolean; // True if newer version available
}>;
recommendations: {
minimal_required: boolean; // Should create manifests
standard_recommended: boolean; // Should link to sources
full_optional: boolean; // Should rewrite with agent-architect
};
}

Project State Classification:

  • non-cami: No .claude/agents/ directory
  • cami-aware: Has agents but no manifest
  • cami-legacy: Has manifest but agents not linked to sources
  • cami-native: Fully normalized with source tracking

Natural Language Examples:

text
"Analyze this project's CAMI state"
"What's the normalization status of ~/projects/my-app?"
"Check if this project needs normalization"

Response Example (cami-aware):

text
# Project Analysis
**Path:** /Users/you/projects/my-app
**State:** cami-aware
**Has Agents Directory:** true
**Has Manifest:** false
**Agent Count:** 3
## Deployed Agents
**frontend** (v2.0.1) - matches official-agents
**backend** (v1.5.0) - matches official-agents (update available)
**custom-helper** (no version) - not in sources
## Recommendations
✓ **Minimal normalization required:** Create manifests for tracking
✓ **Standard normalization recommended:** Link agents to sources

Response Example (cami-native):

text
# Project Analysis
**Path:** /Users/you/projects/my-app
**State:** cami-native
**Has Agents Directory:** true
**Has Manifest:** true
**Agent Count:** 3
## Deployed Agents
**frontend** (v2.0.1) - matches official-agents
**backend** (v2.1.0) - matches official-agents
**designer** (v1.1.0) - matches official-agents
## Recommendations
✓ **Project is fully normalized!**

Normalization Levels:

  1. Minimal (create manifests):
    • Creates .claude/.cami/manifest.yaml
    • Enables basic tracking
    • No source linking required
  2. Standard (link to sources):
    • Minimal + source attribution
    • Enables update detection
    • Recommended for most projects
  3. Full (rewrite agents):
    • Standard + agent-architect rewrite
    • Ensures latest agent templates
    • Optional, only if agents are very outdated

Source Matching:

CAMI tries to match deployed agents to sources by:

  1. Name matching
  2. Content hash comparison (exact match)

If matched:

  • matches_source shows source name
  • needs_upgrade indicates if newer version available

Error Conditions:

  • Project path doesn't exist: Error message
  • Analysis fails: Error with details

See Also:


normalize_project

Purpose: Migrate a project to CAMI standards by creating manifests and linking agents to sources.

When to Use:

  • After detect_project_state recommends normalization
  • Bringing legacy projects into CAMI tracking
  • Enabling update detection for deployed agents

Parameters:

typescript
{
project_path: string; // Required: Absolute path to project
level: string; // Required: "minimal" | "standard" | "full"
}

Returns:

typescript
{
success: boolean;
state_before: string; // State before normalization
state_after: string; // State after normalization
backup_path: string; // Where backup was created
changes: string[]; // List of changes made
undo_available: boolean; // Whether undo is possible
}

Natural Language Examples:

text
"Normalize this project"
"Apply standard normalization to ~/projects/my-app"
"Create manifests for agent tracking"

Minimal Normalization:

typescript
mcp__cami__normalize_project({
project_path: "/Users/you/projects/my-app",
level: "minimal"
})

What it does:

  • Creates .claude/.cami/manifest.yaml
  • Scans deployed agents
  • Creates manifest entries (no source linking)
  • Updates central manifest

Response:

text
# Project Normalization
**Status:** ✓ Success
**State Before:** cami-aware
**State After:** cami-legacy
**Backup Created:** /Users/you/projects/my-app/.claude/.cami/.backups/20251124-103045
## Changes Made
- Created project manifest
- Added 3 agents to manifest
- Updated central deployment tracking

Standard Normalization:

typescript
mcp__cami__normalize_project({
project_path: "/Users/you/projects/my-app",
level: "standard"
})

What it does:

  • Everything in minimal
  • Matches agents to sources by name + content hash
  • Adds source attribution and priority
  • Enables update detection

Response:

text
# Project Normalization
**Status:** ✓ Success
**State Before:** cami-aware
**State After:** cami-native
**Backup Created:** /Users/you/projects/my-app/.claude/.cami/.backups/20251124-103045
## Changes Made
- Created project manifest
- Matched 2 agents to sources:
- frontend → official-agents (priority 50)
- backend → official-agents (priority 50)
- Marked 1 agent as external:
- custom-helper (no source match)
- Updated central deployment tracking
**Undo available:** Use backup.RestoreFromBackup to revert changes

Full Normalization:

WARNING: Full normalization is destructive - it rewrites agent files.

typescript
mcp__cami__normalize_project({
project_path: "/Users/you/projects/my-app",
level: "full"
})

What it does:

  • Everything in standard
  • Invokes agent-architect to rewrite agents
  • Uses latest agent templates
  • Overwrites agent content

When to use full:

  • Agents are very outdated (old template format)
  • Migrating from pre-frontmatter agents
  • Standardizing agents across team

When NOT to use full:

  • Agents have custom modifications
  • Recent agents (already using current templates)
  • Unsure about impact (use minimal/standard first)

Backup Protection:

Before any normalization, CAMI creates a timestamped backup:

text
.claude/.cami/.backups/20251124-103045/
agents/
frontend.md
backend.md
custom-helper.md
manifest.yaml # If existed

State Transitions:

text
non-cami → [normalize minimal] → cami-legacy
cami-aware → [normalize minimal] → cami-legacy
cami-aware → [normalize standard] → cami-native
cami-legacy → [normalize standard] → cami-native

Error Conditions:

  • Invalid level: Error with valid options
  • Project path doesn't exist: Error message
  • Backup creation fails: Error (normalization cancelled)

See Also:


cleanup_backups

Purpose: Remove old backup directories to free disk space.

When to Use:

  • Backup count exceeds threshold (10+)
  • Low disk space
  • Regular maintenance (monthly)

Parameters:

typescript
{
target_path: string; // Required: Project path or source path
keep_recent: number; // Required: Number of backups to keep(default: 3)
}

Returns:

typescript
{
removed_count: number;
freed_bytes: number;
kept_backups: string[]; // Paths to remaining backups
}

Natural Language Examples:

text
"Clean up old backups"
"Remove old backups, keep the 3 most recent"
"Free up space by deleting old backups"

Underlying Tool Call:

typescript
mcp__cami__cleanup_backups({
target_path: "/Users/you/projects/my-app",
keep_recent: 3
})

Response Example:

text
# Backup Cleanup
**Total Backups:** 15
**Total Size:** 12.50 MB
## Cleanup Results
**Removed:** 12 backups
**Freed:** 10.00 MB
**Kept:** 3 backups
**Remaining backups:**
- 20251124-103045
- 20251123-150230
- 20251122-091500

When No Cleanup Needed:

text
# Backup Cleanup
**Total Backups:** 2
**Total Size:** 1.80 MB
No cleanup needed - only 2 backups exist (keeping 3)

Backup Locations:

For projects:

text
<project>/.claude/.cami/.backups/
20251124-103045/
20251123-150230/
...

For sources:

text
~/cami-workspace/sources/.backups/
team-agents-20251124-103045/
team-agents-20251123-150230/
...

Cleanup Logic:

  1. List all backups: In target's .backups/ directory
  2. Sort by timestamp: Newest first
  3. Keep N most recent: Based on keep_recent parameter
  4. Delete older backups: Recursively remove directories
  5. Calculate freed space: Sum of deleted backup sizes

Safety:

  • Never deletes the most recent backup (even if keep_recent=1)
  • Validates backup directory structure before deletion
  • Returns error if deletion fails (doesn't partially delete)

Error Conditions:

  • Target path doesn't exist: Error message
  • No backups found: Returns "No cleanup needed"
  • Deletion fails: Error with details

See Also:


onboard

Purpose: Get personalized onboarding guidance based on current CAMI setup state.

When to Use:

  • User is new to CAMI
  • User asks "what should I do next?"
  • User seems uncertain about workflow

Parameters: None

Returns:

typescript
{
state: {
config_exists: boolean;
is_fresh_install: boolean;
source_count: number;
location_count: number;
has_agent_architect: boolean;
total_agents: number;
deployed_agents: number;
recommended_next: string; // Personalized next step
};
}

Natural Language Examples:

text
"Help me get started with CAMI"
"What should I do next?"
"I'm new to CAMI"

Fresh Install Response:

text
# Welcome to CAMI!
I see this is a fresh installation. Let me guide you through getting started.
## Your CAMI Setup
**CAMI Workspace** (Agent Building): `~/cami-workspace/`
→ Where agent sources and configuration live
→ Manage and create agents globally
**Development Workspace** (Projects): `~/projects/`
→ Where your projects live
→ Where agents get deployed
---
## Three Paths Forward
**Path 1: Add Agent Library** (Recommended for new users)
→ Get pre-built professional agents from a Git repository
→ I can help you find and add agent sources
→ Tell me: 'Add agent source from <git-url>'
**Path 2: Create Custom Agents**
→ Work with agent-architect to build specialized agents
→ Best if you have specific needs
→ Tell me: 'Create a new agent for [task]'
**Path 3: Import Existing Agents**
→ Already have agents deployed in other projects?
→ I can scan and track them in CAMI
→ Tell me: 'Import agents from [project-path]'
**Which path interests you?**

Configured Installation Response:

text
# CAMI Setup Status
## Your CAMI Setup
**CAMI Workspace**: `~/cami-workspace/`
→ Where agent sources and config live
**Development Workspace**: `~/projects/`
→ Where your projects live
**Tracked Projects**: 3
→ Projects CAMI knows about
---
## Agent Sources
✓ 2 source(s) configured
✓ 15 agents available
## Available Agents
You have access to 15 agents.
- Use `mcp__cami__list_agents` to see all available agents
- Use `mcp__cami__deploy_agents` to add agents to projects
## Deployed Agents (Current Project)
**No agents deployed in this project yet**
## Quick Commands
**List agents:** `mcp__cami__list_agents`
**Deploy agents:** `mcp__cami__deploy_agents`
**Scan current project:** `mcp__cami__scan_deployed_agents`
**Add agent source:** `mcp__cami__add_source`
**Update sources:** `mcp__cami__update_source`
**Recommended next step:** Deploy agents to current project

Fresh Install Detection:

CAMI considers an installation "fresh" if:

  • Config exists but setup_complete: false
  • Only has default "my-agents" source with no git
  • No agents loaded
  • No locations tracked

Personalized Recommendations:

CAMI analyzes your state and suggests the most relevant next step:

  • No sources - "Add agent sources"
  • Sources but no agents - "Add agent sources or create agents"
  • Agents available but none deployed - "Deploy agents to current project"
  • Agents deployed - "Explore and manage your agents"

Error Conditions: None (always succeeds with current state)

See Also:


Complete Tool Reference

Agent Management

ToolPurposeParametersKey Use Case
list_agentsDiscover available agentsNone"What agents are available?"
deploy_agentsCopy agents to projectsagent_names, target_path, overwrite"Deploy frontend to my-app"
scan_deployed_agentsAudit deployed agentstarget_path"What agents are deployed here?"
update_claude_mdDocument deployed agentstarget_path"Update project documentation"
import_agentsTrack external agentsproject_path, dry_run"Import agents from legacy project"

Source Management

ToolPurposeParametersKey Use Case
add_sourceClone agent repositoryurl, name, priority"Add agent source from git@..."
list_sourcesView configured sourcesNone"What sources are configured?"
update_sourcePull latest from Gitname (optional)"Update all sources"
source_statusCheck Git statusNone"Do sources have uncommitted changes?"
detect_source_stateAnalyze compliancesource_name"Check team-agents for issues"
normalize_sourceFix compliance issuessource_name, flags"Fix compliance in team-agents"

Project Management

ToolPurposeParametersKey Use Case
add_locationRegister projectname, path"Save this project for quick access"
list_locationsView saved locationsNone"What projects are registered?"
remove_locationUnregister projectname"Remove old-project location"
create_projectInitialize new projectname, description, agents, vision"Create a new React app project"

Normalization & Utility

ToolPurposeParametersKey Use Case
detect_project_stateAnalyze project stateproject_path"What's this project's CAMI state?"
normalize_projectMigrate to CAMI standardsproject_path, level"Normalize this project"
cleanup_backupsRemove old backupstarget_path, keep_recent"Clean up old backups"
onboardGet setup guidanceNone"What should I do next?"

Common Workflows

First-Time Setup

text
1. User: "Help me get started with CAMI"
Tool: onboard
2. User: "Add agent source from git@github.com:lando/agents.git"
Tool: add_source
3. User: "What agents are available?"
Tool: list_agents
4. User: "Deploy frontend and backend to ~/projects/my-app"
Tool: deploy_agents
5. User: "Update the documentation"
Tool: update_claude_md

Creating a New Project

text
1. User: "Create a new project"
[Claude uses AskUserQuestion to gather requirements]
2. Tool: list_agents (Claude checks available specialists)
3. [Claude recommends agents based on requirements]
User confirms
4. Tool: create_project
Result: Project created with agents and CLAUDE.md

Updating Deployed Agents

text
1. User: "Update my agents"
Tool: scan_deployed_agents (check current versions)
2. Tool: update_source (pull latest from Git)
3. Tool: scan_deployed_agents (verify updates available)
4. Tool: deploy_agents (with overwrite=true)
5. Tool: update_claude_md (document new versions)

Migrating a Legacy Project

text
1. User: "Bring this project into CAMI"
Tool: detect_project_state (analyze current state)
2. [Claude shows analysis and recommendations]
3. User: "Normalize it"
Tool: normalize_project (level: "standard")
4. Tool: scan_deployed_agents (verify normalization)
5. Tool: update_claude_md (document agents)

Source Compliance Fix

text
1. Tool: add_source (clone new source)
Response: "This source has compliance issues"
2. Tool: detect_source_state (detailed analysis)
3. User: "Fix the issues"
Tool: normalize_source (add versions, descriptions, .camiignore)
4. Tool: list_sources (verify compliance: ✓)

Natural Language Interface

How Claude Interprets Your Requests

Deployment Requests:

text
"Deploy frontend to my-app"
→ Looks up "my-app" in locations
→ Calls deploy_agents with full path
"Add designer to this project"
→ Uses current working directory
→ Calls deploy_agents
"Update frontend and backend"
→ Interprets as deploy with overwrite=true
→ Calls deploy_agents with overwrite=true

Source Management:

text
"Add agent source from <url>"
→ Calls add_source with URL
→ Auto-detects compliance
→ Suggests normalize_source if needed
"Update all sources"
→ Calls update_source with no name
→ Updates all git-enabled sources
"Pull latest changes for team-agents"
→ Calls update_source with name="team-agents"

Project Management:

text
"Create a new project"
→ Asks questions to gather requirements
→ Calls list_agents to check availability
→ Recommends agents
→ Calls create_project with user-confirmed agents
"What projects are registered?"
→ Calls list_locations

Information Requests:

text
"What agents are available?"
→ Calls list_agents
"What's deployed in this project?"
→ Calls scan_deployed_agents
"What should I do next?"
→ Calls onboard

Context-Aware Behavior

Claude uses context to infer parameters:

Current Directory:

text
You: [In ~/projects/my-app]
You: "What agents are deployed here?"
Claude: [Calls scan_deployed_agents with current directory]

Location Names:

text
You: "Deploy frontend to my-app"
Claude: [Looks up "my-app" in locations]
[Uses full path: /Users/you/projects/my-app]
[Calls deploy_agents]

Implicit Overwrite:

text
You: "Update the frontend agent"
Claude: [Interprets "update" as overwrite=true]
[Calls deploy_agents with overwrite=true]

Error Recovery:

text
Tool: deploy_agents fails (agent not found)
Claude: "The 'frontent' agent doesn't exist. Did you mean 'frontend'?"
[Suggests correction based on list_agents]

Error Handling

Common Error Patterns

Agent Not Found:

json
Error: "agents not found: ['frontent']"

Claude's response:

text
I couldn't find the 'frontent' agent. Did you mean 'frontend'?
Available agents: frontend, backend, designer, qa

Path Validation Errors:

json
Error: "invalid target path: path does not exist: /Users/you/projects/typo"

Claude's response:

text
The path /Users/you/projects/typo doesn't exist.
Did you mean one of these registered locations?
- my-app: /Users/you/projects/my-app
- api-backend: /Users/you/projects/api-backend

Conflict Errors:

json
{
results: [{
agent_name: "frontend",
success: false,
conflict: true,
message: "File already exists (use overwrite=true to replace)"
}]
}

Claude's response:

text
The frontend agent is already deployed. Would you like me to:
1. Overwrite with the latest version
2. Keep the existing version
3. Compare the versions first

No Sources Configured:

json
Error: "no agent sources configured - run 'cami source add <git-url>'"

Claude's response:

text
You don't have any agent sources configured yet.
I can help you add an agent source! Just tell me:
- The Git URL of your agent repository
Or if you don't have one, I can guide you through creating custom agents.

Error Recovery Strategies

Claude uses multiple strategies to recover from errors:

  1. Spelling Correction: Fuzzy matching on agent names
  2. Path Suggestion: Offers registered locations when path invalid
  3. Clarification Questions: Asks for missing information
  4. Alternative Solutions: Suggests different approaches
  5. Setup Guidance: Detects setup issues and offers onboarding

Advanced Topics

Priority-Based Source Resolution

When multiple sources contain the same agent name, CAMI uses priority-based deduplication:

yaml
agent_sources:
- name: my-agents
priority: 10 # Highest priority
- name: team-agents
priority: 50 # Medium priority
- name: official-agents
priority: 100 # Lowest priority

Resolution Example:

All three sources have "frontend.md":

  • my-agents/frontend.md (v3.0.0-custom)
  • team-agents/frontend.md (v2.5.0-team)
  • official-agents/frontend.md (v2.0.1)

list_agents returns:

text
• frontend (v3.0.0-custom)
[From my-agents source]

deploy_agents deploys my-agents/frontend.md (priority 10 wins).

Use Cases:

  1. Personal Overrides (priority 1-10):
    • Customized versions of team agents
    • Experimental modifications
    • Project-specific adaptations
  2. Team Standards (priority 20-40):
    • Company-approved agents
    • Shared best practices
    • Team conventions
  3. Official Libraries (priority 50-100):
    • Community agents
    • Third-party libraries
    • Default templates

Verification:

text
You: "Which frontend agent is active?"
Claude: [Calls list_agents]
[Shows: "frontend (v3.0.0-custom) from my-agents"]

Manifest System

CAMI uses two manifest files to track agent deployments:

Project Manifest (.claude/.cami/manifest.yaml):

Tracks agents deployed in a specific project.

yaml
version: "1"
state: cami-native # non-cami | cami-aware | cami-legacy | cami-native
normalized_at: 2025-11-24T10:30:00Z
agents:
- name: frontend
version: "2.0.1"
source: official-agents # Source that provided this agent
source_path: /Users/you/cami-workspace/sources/official-agents/frontend.md
priority: 50 # Priority of source
deployed_at: 2025-11-24T10:30:00Z
content_hash: abc123def456... # SHA-256 of agent content
metadata_hash: def456abc123... # SHA-256 of frontmatter
origin: cami # "cami" | "external"

Central Manifest (~/cami-workspace/central-manifest.yaml):

Tracks all deployments across all projects (global view).

yaml
deployments:
/Users/you/projects/my-app:
state: cami-native
normalized_at: 2025-11-24T10:30:00Z
last_scanned: 2025-11-24T10:30:00Z
agents:
- name: frontend
version: "2.0.1"
# ... same fields as project manifest
/Users/you/projects/api-backend:
state: cami-native
normalized_at: 2025-11-24T10:35:00Z
last_scanned: 2025-11-24T10:35:00Z
agents:
- name: backend
version: "2.1.0"
# ...

Manifest States:

  • non-cami: Project has no .claude/agents/ directory
  • cami-aware: Has agents but no manifest
  • cami-legacy: Has manifest but agents not linked to sources
  • cami-native: Fully normalized with source tracking

Hash System:

Content Hash (SHA-256 of agent content):

  • Includes entire file (frontmatter + markdown content)
  • Used for exact-match detection
  • Detects any content changes

Metadata Hash (SHA-256 of frontmatter only):

  • Includes only YAML frontmatter
  • Used for metadata-only change detection
  • Ignores content changes

Use cases:

  • Content hash different - Agent content changed
  • Metadata hash different, content same - Only frontmatter changed
  • Both same - Exact match to source

Workspace Organization

CAMI uses a structured workspace:

text
~/cami-workspace/ # Or $CAMI_DIR
├── config.yaml # Global configuration
├── central-manifest.yaml # All deployments tracking
└── sources/ # Agent source repositories
├── official-agents/
│ ├── .camiignore
│ ├── frontend.md
│ ├── backend.md
│ └── ...
├── team-agents/
│ ├── .camiignore
│ └── ...
└── .backups/ # Source normalization backups
└── team-agents-20251124-103045/
text
~/projects/ # Or custom projects dir
└── my-app/
├── .claude/
│ ├── agents/ # Deployed agents
│ │ ├── frontend.md
│ │ └── backend.md
│ └── .cami/
│ ├── manifest.yaml # Project manifest
│ └── .backups/ # Project normalization backups
│ └── 20251124-103045/
└── CLAUDE.md # Project documentation

Environment Variable:

Set CAMI_DIR to use a custom workspace location:

bash
export CAMI_DIR=~/my-custom-cami-workspace

All tools respect this environment variable.


Tool Design Patterns

Idempotent Operations

These tools can be run multiple times safely:

  • update_claude_md - Rewrites managed section
  • scan_deployed_agents - Read-only analysis
  • list_agents, list_sources, list_locations - Read-only
  • detect_source_state, detect_project_state - Read-only analysis

Destructive Operations

These tools modify files/directories:

  • deploy_agents (with overwrite=true)
  • normalize_source (modifies agent frontmatter)
  • normalize_project (creates manifests, level=full rewrites agents)

Protection: All destructive operations create backups before changes.

Dry Run Support

Tools that support preview before execution:

  • import_agents (dry_run parameter)

Pattern:

text
1. Run with dry_run=true (preview)
2. Review changes
3. Run with dry_run=false (execute)

Backup Strategy

CAMI creates timestamped backups before destructive operations:

Format: YYYYMMDD-HHMMSS (e.g., 20251124-103045)

Locations:

  • Source backups: ~/cami-workspace/sources/.backups/
  • Project backups: <project>/.claude/.cami/.backups/

Retention:

  • No automatic cleanup (use cleanup_backups)
  • Recommended: Keep 3-5 most recent

MCP Server Configuration

To use these tools, configure CAMI in Claude Code's MCP settings.

Location: ~/.config/claude/mcp.json (or platform-specific config directory)

Configuration:

json
{
"mcpServers": {
"cami": {
"command": "cami",
"args": ["--mcp"]
}
}
}

Restart Required: After changing MCP config, restart Claude Code.

Verification:

After configuration, Claude will have access to all 19 tools with mcp__cami__ prefix:

  • mcp__cami__list_agents
  • mcp__cami__deploy_agents
  • mcp__cami__add_source
  • etc.

Troubleshooting:

If tools aren't available:

  1. Check config syntax (valid JSON)
  2. Verify cami command is in PATH
  3. Restart Claude Code
  4. Check logs in Claude Code's MCP console

See Also:


Related Documentation


Last Updated: 2025-11-24