Agent skill
mcp-access-validator
Install this agent skill to your Project
npx add-skill https://github.com/Reneromero08/agent-governance-system/tree/main/MEMORY/ARCHIVE/skills-deprecated/mcp-access-validator
SKILL.md
required_canon_version: >=3.0.0
MCP Access Validator
Skill ID: mcp-access-validator
Version: 1.0.0
Status: Deprecated
DEPRECATED: This skill has been consolidated into
mcp-toolkit. Use{"operation": "validate_access", ...}with the mcp-toolkit instead. Tags: mcp, governance, validation, token-efficiency
Purpose
Prevents token waste by validating that agents use the MCP server's existing tools instead of writing custom database queries or manual file inspection. This skill enforces the "MCP-first" principle for all cortex access.
Problem Statement
Agents waste tokens by:
- Writing Python SQLite snippets to inspect databases directly
- Running manual file system operations instead of using
cortex_query - Creating custom scripts for tasks already covered by MCP tools
- Analyzing database schemas instead of using semantic search tools
This violates the catalytic computing principle of token efficiency and bypasses the governance layer.
Solution
The MCP Access Validator skill:
- Detects when an agent is performing manual database/file operations
- Recommends the appropriate MCP tool for the task
- Provides a token efficiency score for the agent's approach
- Generates audit logs of token waste incidents
Input Schema
{
"agent_action": "string describing what the agent is trying to do",
"agent_code_snippet": "optional code the agent wrote",
"files_accessed": ["list of files the agent accessed manually"],
"databases_queried": ["list of databases the agent queried directly"]
}
Output Schema
{
"validation_passed": "boolean",
"token_waste_detected": "boolean",
"recommended_mcp_tool": "string",
"tool_usage_example": "object",
"estimated_token_savings": "number",
"audit_entry": "object"
}
Usage Examples
Example 1: Manual Database Query
Agent Action: "I need to check what's in the system1.db database"
Agent Code: import sqlite3; conn = sqlite3.connect('CORTEX/_generated/system1.db'); cursor = conn.execute('SELECT * FROM symbols')
Validation Result:
token_waste_detected: truerecommended_mcp_tool:cortex_querytool_usage_example:cortex_query({"query": "symbols"})estimated_token_savings: 95%
Example 2: Manual File Reading
Agent Action: "I want to read the CONTRACT.md file"
Agent Code: open('LAW/CANON/CONTRACT.md').read()
Validation Result:
token_waste_detected: truerecommended_mcp_tool:canon_readtool_usage_example:canon_read({"file": "CONTRACT"})estimated_token_savings: 90%
Implementation
The skill works by:
- Parsing the agent's action description and code
- Matching patterns against known MCP tool capabilities
- Calculating token efficiency based on:
- MCP tool response size vs manual code size
- Governance compliance overhead
- Audit logging completeness
- Generating actionable recommendations
Governance Impact
This skill directly supports:
- ADR-021: Mandatory Agent Identity (uses session_id for audit)
- ADR-004: MCP Integration (enforces tool usage)
- Catalytic Computing: Token efficiency principles
- AGENTS.md Section 0: Cortex connection requirements
Dependencies
- MCP server running with available tools
- Audit log directory (
LAW/CONTRACTS/_runs/mcp_logs/) - Session ID for agent identification
Error Handling
If the MCP server is not accessible, the skill will:
- Return a validation failure
- Provide connection instructions
- Log the incident for governance review
Performance
- Validation time: < 100ms
- Memory usage: < 10MB
- No external network calls (uses local MCP server)
Security
- Read-only validation
- No file system modifications
- All audit logs are append-only
- Session ID verification for ADR-021 compliance
Testing
See fixtures/ directory for test cases covering:
- Valid MCP tool usage
- Manual database query detection
- File system access detection
- Mixed usage scenarios
- Edge cases and error conditions
Maintenance
This skill should be updated when:
- New MCP tools are added
- Token efficiency metrics change
- Governance requirements evolve
- Agent behavior patterns shift
Related Skills
session-info-validator: Validates ADR-021 compliancecortex-query-optimizer: Optimizes MCP tool usagetoken-efficiency-auditor: Comprehensive token usage analysis
required_canon_version: >=3.0.0
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
mcp-adapter
pipeline-dag-scheduler
cortex-summaries
llm-packer-smoke
artifact-escape-hatch
mcp-message-board
Didn't find tool you were looking for?