source-command-unifi-mcp-add-tool
Skill294 starsChanged 18 days agoApache-2.0View on GitHub
Scaffold a new UniFi MCP tool with model, function, tests, and docs
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 10 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill when the user asks to run the migrated source command unifi-mcp-add-tool.
- Distinctive: line 18
Ask the user for tool details:
- Very specific: line 25
Create or update the Pydantic model in src/models/:
- Distinctive: line 26
If the model file for the category doesn't exist, create it
- Distinctive: line 27
Add request/response models based on UniFi API schema
- Distinctive: line 29
Add validators if needed
- Very specific: line 31
Create the tool function in src/tools/:
- Distinctive: line 32
If the tool file for the category doesn't exist, create it
- Distinctive: line 34
Add confirmation/dry-run support for mutating operations
- Very specific: line 46
Create comprehensive unit tests in tests/unit/:
- Very specific: line 47
Test file following naming convention: test_<category>_tools.py
- Distinctive: line 56
Add tool to appropriate category section
- Distinctive: line 87
Never expose sensitive credentials in code
- Distinctive: line 88
Always use async/await for I/O operations
- Distinctive: line 90
Follow the principle of least privilege
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
source-command-unifi-mcp-add-tool
Use this skill when the user asks to run the migrated source command unifi-mcp-add-tool.
Command Template
Scaffold a complete new MCP tool for the UniFi MCP Server.
This command creates all necessary files and code for a new tool following the project's architecture and standards.
Steps to execute:
- Ask the user for tool details:
- Tool name (e.g., "get_port_profile")
- Tool category (e.g., "networks", "devices", "clients", "firewall")
- Brief description of what the tool does
- UniFi API endpoint it will use
- Whether it's a read-only or mutating operation
- Create or update the Pydantic model in
src/models/:- If the model file for the category doesn't exist, create it
- Add request/response models based on UniFi API schema
- Include proper type hints and field descriptions
- Add validators if needed
- Create the tool function in
src/tools/:- If the tool file for the category doesn't exist, create it
- Implement async tool function with proper error handling
- Add confirmation/dry-run support for mutating operations
- Include comprehensive docstring with:
- Description
- Parameters
- Returns
- Raises
- Example usage
- Register the tool in
src/main.py:- Add import statement
- Register tool with FastMCP
- Create comprehensive unit tests in
tests/unit/:- Test file following naming convention:
test_<category>_tools.py - Include tests for:
- Success case with mocked API response
- Error handling (authentication, network, API errors)
- Validation of parameters
- Confirmation/dry-run mode (if applicable)
- Aim for 80%+ coverage
- Test file following naming convention:
- Update API.md documentation:
- Add tool to appropriate category section
- Include description, parameters, returns, example
- Run validation:
- Format code:
black src/ tests/ - Check tests:
pytest tests/unit/test_<category>_tools.py -v - Verify registration:
python -c "from src.main import mcp; print(mcp.list_tools())"
- Format code:
Report back with:
- Summary of files created/modified
- Tool registration confirmation
- Test results
- Next steps for integration testing
- Reminder to update TESTING_PLAN.md if needed
Example workflow:
User: "I want to add a tool to get WLAN groups"
Assistant:
1. Creates src/models/wifi.py with WLANGroupResponse model
2. Creates src/tools/wifi.py with get_wlan_groups() function
3. Updates src/main.py to register the tool
4. Creates tests/unit/test_wifi_tools.py
5. Updates API.md with documentation
6. Runs tests and reports resultsSafety checks:
- Never expose sensitive credentials in code
- Always use async/await for I/O operations
- Include proper type hints for all parameters
- Follow the principle of least privilege
- Validate all user inputs
In this repository52 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/fastmcp/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- .claude/skills/fastmcp/CLAUDE.mdCLAUDE.md
- .cursor/rules/common-mistakes.mdcCursor rule
- .cursor/rules/core-principles.mdcCursor rule
- .cursor/rules/environment-setup.mdcCursor rule
- .cursor/rules/mcp-tools.mdcCursor rule
- .cursor/rules/project-context.mdcCursor rule
- .cursor/rules/README.mdCursor rule
- .cursor/rules/unifi-api.mdcCursor rule
- .cursor/rules/workflow.mdcCursor rule
- FastMCP DevelopmentSkill
- mcp-builderSkill
- source-command-build-dockerSkill
- source-command-check-depsSkill
- source-command-cleanSkill
- source-command-docsSkill
- source-command-formatSkill
- source-command-lintSkill
- source-command-prSkill
- source-command-securitySkill
- source-command-setupSkill
- source-command-testSkill
- source-command-unifi-api-docs-update-2Skill
- source-command-unifi-api-docs-updateSkill
- source-command-unifi-mcp-release-prepSkill
- source-command-unifi-mcp-test-coverageSkill
- source-command-unifi-mcp-update-docsSkill
- unifi-cloud-fleet-toolsSkill
- unifi-mcp-tool-builderSkill
- unifi-network-config-toolsSkill
- unifi-protect-toolsSkill
- unifi-security-toolsSkill
- FastMCP DevelopmentSkill
- mcp-builderSkill
- unifi-cloud-fleet-toolsSkill
- unifi-mcp-tool-builderSkill
- unifi-network-config-toolsSkill
- unifi-protect-toolsSkill
- unifi-security-toolsSkill
- unifiSkill
- unifi-channel-planningSkill
- unifi-cloud-fleet-toolsSkill
- unifi-devicesSkill
- unifi-mcp-tool-builderSkill
- unifi-network-config-toolsSkill
- unifi-networkSkill
- unifi-protect-toolsSkill
- unifi-securitySkill
- unifi-security-toolsSkill
- unifi-systemSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

