Examples
This section provides practical examples of custom agent configurations for common development workflows and use cases.
AWS specialist custom agent
This custom agent is optimized for AWS infrastructure management and development tasks. It provides pre-approved access to AWS tools while including relevant documentation.
Example AWS specialist custom agent configuration
{ "description": "Specialized custom agent for AWS infrastructure and development tasks", "tools": [ "fs_read", "fs_write", "execute_bash", "use_aws" ], "allowedTools": [ "fs_read", "use_aws" ], "toolsSettings": { "use_aws": { "allowedServices": [ "s3", "lambda", "cloudformation", "ec2", "iam", "logs" ] }, "fs_write": { "allowedPaths": [ "infrastructure/**", "scripts/**", "*.yaml", "*.yml", "*.json" ] } }, "resources": [ "file://README.md", "file://infrastructure/**/*.yaml", "file://infrastructure/**/*.yml", "file://docs/aws-setup.md", "file://scripts/deploy.sh" ], "hooks": { "agentSpawn": [ { "command": "aws sts get-caller-identity", "timeout_ms": 10000, "cache_ttl_seconds": 300 } ] } }
Use cases for this custom agent:
-
Deploying CloudFormation stacks
-
Managing S3 buckets and Lambda functions
-
Troubleshooting AWS service issues
-
Reviewing and updating infrastructure as code
Development workflow custom agent
This custom agent is designed for general software development tasks, including code review, testing, and Git operations.
Example Development workflow custom agent configuration
{ "description": "General development workflow custom agent with Git integration", "mcpServers": { "git": { "command": "git-mcp-server", "args": [], "timeout": 30000 } }, "tools": [ "fs_read", "fs_write", "execute_bash", "@git" ], "allowedTools": [ "fs_read", "@git/git_status", "@git/git_log", "@git/git_diff" ], "toolAliases": { "@git/git_status": "status", "@git/git_log": "log", "@git/git_diff": "diff" }, "toolsSettings": { "fs_write": { "allowedPaths": [ "src/**", "tests/**", "docs/**", "*.md", "*.json", "package.json", "requirements.txt" ] } }, "resources": [ "file://README.md", "file://CONTRIBUTING.md", "file://docs/**/*.md", "file://package.json", "file://requirements.txt" ], "hooks": { "agentSpawn": [ { "command": "git status --porcelain", "timeout_ms": 5000 }, { "command": "git branch --show-current", "timeout_ms": 3000 } ] } }
Use cases for this custom agent:
-
Code review and analysis
-
Writing and updating tests
-
Git workflow management
-
Documentation updates
-
Dependency management
Code review custom agent
This custom agent focuses specifically on code review tasks, with tools and context optimized for analyzing code quality, security, and best practices.
Example Code review custom agent configuration
{ "description": "Specialized custom agent for code review and quality analysis", "tools": [ "fs_read", "execute_bash" ], "allowedTools": [ "fs_read", "execute_bash" ], "toolsSettings": { "execute_bash": { "allowedCommands": [ "grep", "find", "wc", "head", "tail", "cat", "diff", "git diff", "git log", "eslint", "pylint", "rubocop" ] } }, "resources": [ "file://CONTRIBUTING.md", "file://docs/coding-standards.md", "file://docs/security-guidelines.md", "file://.eslintrc.json", "file://.pylintrc", "file://pyproject.toml" ], "hooks": { "agentSpawn": [ { "command": "git diff --name-only HEAD~1", "timeout_ms": 5000, "max_output_size": 2048 } ], "userPromptSubmit": [ { "command": "find . -name '*.py' -o -name '*.js' -o -name '*.ts' | wc -l", "timeout_ms": 3000, "cache_ttl_seconds": 60 } ] } }
Use cases for this custom agent:
-
Reviewing pull requests for code quality
-
Identifying security vulnerabilities
-
Checking adherence to coding standards
-
Analyzing code complexity and maintainability
-
Suggesting improvements and refactoring opportunities
Project-specific custom agent
This example shows how to create an custom agent tailored to a specific project, including project-specific tools, documentation, and build processes.
Example Project-specific custom agent configuration
{ "description": "Custom agent for the mobile app backend project", "mcpServers": { "docker": { "command": "docker-mcp-server", "args": ["--socket", "/var/run/docker.sock"] }, "database": { "command": "postgres-mcp-server", "args": ["--connection", "postgresql://localhost:5432/myapp"], "env": { "PGPASSWORD": "$DATABASE_PASSWORD" } } }, "tools": [ "fs_read", "fs_write", "execute_bash", "@docker", "@database" ], "allowedTools": [ "fs_read", "@docker/docker_ps", "@docker/docker_logs", "@database/query_read_only" ], "toolAliases": { "@docker/docker_ps": "containers", "@docker/docker_logs": "logs", "@database/query_read_only": "query" }, "toolsSettings": { "fs_write": { "allowedPaths": [ "src/**", "tests/**", "migrations/**", "docker-compose.yml", "Dockerfile", "requirements.txt" ] }, "execute_bash": { "allowedCommands": [ "npm test", "npm run build", "python manage.py test", "docker-compose up", "docker-compose down" ] } }, "resources": [ "file://README.md", "file://docs/api-documentation.md", "file://docs/database-schema.md", "file://docker-compose.yml", "file://requirements.txt", "file://src/config/settings.py" ], "hooks": { "agentSpawn": [ { "command": "docker-compose ps", "timeout_ms": 10000, "cache_ttl_seconds": 30 }, { "command": "git status --porcelain", "timeout_ms": 5000 } ] } }
Use cases for this custom agent:
-
Managing Docker containers and services
-
Running database queries and migrations
-
Building and testing the application
-
Debugging production issues
-
Updating API documentation
Tips for creating effective custom agents
-
Start simple - Begin with basic tool configurations and add complexity as needed
-
Use descriptive names - Choose custom agent names that clearly indicate their purpose
-
Include relevant context - Add project documentation and configuration files to resources
-
Pre-approve safe tools - Include frequently used, low-risk tools in allowedTools
-
Use hooks for dynamic context - Include current system state through command hooks
-
Limit tool scope - Use toolsSettings to restrict tool access to relevant paths and services
-
Test thoroughly - Verify that your custom agent configuration works as expected
-
Document your custom agents - Use clear descriptions to help team members understand custom agent purposes