Core CLI tool patterns for building on top of deft-mcp
Build CLI tools that integrate with the Deft Suite infrastructure using standard patterns and APIs.
search_skills, get_skill — discover and inspect skillsinstall_skill, uninstall_skill — manage installationsget_config, set_config — manage settingsget_status, scan_skills — monitor and diagnosesync_skills — reconcile state with lock fileAll tools receive a ToolContext containing:
All tools return structured errors:
{
"category": "INVALID_ARGUMENT|NOT_FOUND|PERMISSION_DENIED",
"code": "SKILL_NOT_FOUND",
"message": "Human-readable error description",
"recoverable": true,
"retry": false
}
Implement tool handlers as functions:
async function handleTool(context: ToolContext, args: Record<string, unknown>) {
// Validate inputs
// Call service methods
// Return structured result or error
}
Use tiered timeouts: