validate_action
Pre-flight safety check for a skill action: validates security grade, detects parameter injection, and returns safe_to_proceed. Use before executing actions with side effects.
Instructions
Pre-flight safety check before executing an action on a skill. Returns a validation result with safe_to_proceed (boolean), risk_level, security_grade, warnings array, and whether the skill is verified. Checks the skill's security grade, safety manifest, parameter injection patterns, and how recently it was updated. Use this before calling any skill action that could have side effects (writes, deletes, network requests). Do not skip this step for skills with security grade C or F.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | Skill slug in owner/repo format. Examples: 'supabase/mcp', 'microsoft/playwright-mcp'. Must be a valid slug from the registry. | |
| action | Yes | The specific action about to be performed on the skill. Examples: 'query_database', 'write_file', 'send_email', 'delete_record'. Use the actual tool/action name the skill provides. | |
| parameters | No | The parameters that will be passed to the action. These are scanned for prompt injection patterns. Pass the exact parameters you intend to use. Omit if the action takes no parameters. |
Implementation Reference
- src/src/index.ts:444-469 (schema)Tool registration/schema for validate_action, defining input parameters slug, action, and optional parameters.
{ name: "validate_action", description: "Validate whether an action on a skill is safe before executing it. Checks security grade, safety manifest, parameter injection, and skill freshness.", inputSchema: { type: "object" as const, properties: { slug: { type: "string", description: "Skill slug in owner/repo format. Example: 'supabase/mcp'", }, action: { type: "string", description: "The action about to be performed. Example: 'query_database'", }, parameters: { type: "object", description: "Parameters that will be passed to the action. Checked for injection patterns.", }, }, required: ["slug", "action"], }, }, - src/src/index.ts:1151-1200 (handler)Handler function that POSTs to /api/agent/validate with slug, action, and optional parameters, then formats the validation result including validity, risk level, security grade, skill verification, last updated, and warnings.
async function handleValidateAction(args: { slug: string; action: string; parameters?: Record<string, unknown>; }): Promise<string> { const body: Record<string, unknown> = { slug: args.slug, action: args.action, agent_key: AGENT_KEY, }; if (args.parameters) { body.parameters = args.parameters; } const result = (await postJSON(`${API_BASE}/validate`, body)) as { valid?: boolean; risk_level?: string; security_grade?: string; warnings?: string[]; skill_verified?: boolean; last_updated_days_ago?: number; error?: string; }; if (result.error) { return `Validation failed: ${result.error}`; } const lines = [ `Validation result for ${args.slug} / ${args.action}:`, ` Safe to proceed: ${result.valid ? "YES" : "NO"}`, ` Risk level: ${result.risk_level ?? "unknown"}`, ` Security grade: ${result.security_grade ?? "unknown"}`, ` Skill verified: ${result.skill_verified ? "yes" : "no"}`, ]; if (result.last_updated_days_ago !== undefined) { lines.push(` Last updated: ${result.last_updated_days_ago} days ago`); } const warnings = result.warnings ?? []; if (warnings.length > 0) { lines.push(` Warnings:`); for (const w of warnings) { lines.push(` - ${w}`); } } return lines.join("\n"); } - src/src/index.ts:1365-1373 (registration)Dispatch/call site for validate_action in the tools/call handler switch statement.
case "validate_action": resultText = await handleValidateAction( toolArgs as { slug: string; action: string; parameters?: Record<string, unknown>; } ); break;