get-active-rules
List active access rules to understand why secret access was blocked in the SecureCode secrets vault.
Instructions
List active MCP access rules. Read-only — rules can only be created or modified from the dashboard. Use this to understand why access to a secret was blocked.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:722-748 (handler)The implementation of the get-active-rules MCP tool, which fetches active access rules from the SecureCode client and formats them for the user.
// Tool: get-active-rules (read-only) server.tool( 'get-active-rules', 'List active MCP access rules. Read-only — rules can only be created or modified from the dashboard. Use this to understand why access to a secret was blocked.', {}, async () => { try { const client = getClient(); const rules = await client.getActiveRules(); if (rules.length === 0) { return wrapResponse([{ type: 'text', text: 'No active MCP rules configured.' }]); } const lines = rules.map(r => { const condStr = r.conditions .map(c => `${c.tagKey}:${c.tagValue}`) .join(r.conditionOperator === 'AND' ? ' AND ' : ' OR '); return `• ${r.name} — when [${condStr}] → ${r.action}`; }); return wrapResponse([{ type: 'text', text: `${rules.length} active rules:\n${lines.join('\n')}\n\nManage rules at securecodehq.com/dashboard/mcp-rules`, }]); } catch (error) { return errorResult(error); } }, );