Skip to main content
Glama
arian-gogani

Nobulex MCP Compliance Server

by arian-gogani

check_action

Verify if an action complies with covenant rules by checking permissions against defined parameters to determine allowance or blockage.

Instructions

Check whether an action is allowed or blocked by the current covenant rules.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe action name to check, e.g. 'delete_user'
paramsNoOptional parameters for the action

Implementation Reference

  • The core logic for checking an action against a set of rules.
    export function checkAction(
      action: string,
      _params: Record<string, unknown>,
      rules: Rule[]
    ): CheckResult {
      // Rules are evaluated in order; first match wins
      for (const rule of rules) {
        const matches =
          rule.action === "*" || rule.action === action || action.startsWith(rule.action + ".");
    
        if (!matches) continue;
    
        if (rule.type === "forbid") {
          return {
            allowed: false,
            action,
            matchedRule: rule,
            reason: rule.reason ?? `Action "${action}" is forbidden.`,
          };
        }
    
        if (rule.type === "permit") {
          return {
            allowed: true,
            action,
            matchedRule: rule,
            reason: rule.reason ?? `Action "${action}" is permitted.`,
          };
        }
    
        // "require" — treated as permit (the requirement is informational for the agent)
        if (rule.type === "require") {
          return {
            allowed: true,
            action,
            matchedRule: rule,
            reason: rule.reason ?? `Action "${action}" is permitted (requirement noted).`,
          };
        }
      }
    
      // Default: no matching rule → allowed (open policy)
      return {
        allowed: true,
        action,
        matchedRule: null,
        reason: `No rule matched action "${action}"; allowed by default.`,
      };
    }
  • src/index.ts:52-78 (registration)
    Registration of the 'check_action' tool in the MCP server.
    server.tool(
      "check_action",
      "Check whether an action is allowed or blocked by the current covenant rules.",
      {
        action: z.string().describe("The action name to check, e.g. 'delete_user'"),
        params: z
          .record(z.string(), z.unknown())
          .optional()
          .default({})
          .describe("Optional parameters for the action"),
      },
      async ({ action, params }) => {
        const result = checkAction(action, params, rules);
        auditLog.append(action, params, {
          allowed: result.allowed,
          reason: result.reason,
        });
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      }
    );

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so description carries full burden. It implies a read-only check with no side effects, but does not disclose auth needs, rate limits, or behavior for missing actions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, concise sentence with no wasted words. The purpose is front-loaded with the verb 'Check'.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with 2 parameters and no output schema, the description is mostly complete. It could benefit from mentioning the return format (e.g., boolean or status), but the core behavior is clear.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, with clear descriptions for both parameters. The description adds only an example ('e.g. delete_user'), which is marginally helpful but not necessary.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool checks whether an action is allowed or blocked by covenant rules, using specific verb 'Check' and resource 'action'. It distinguishes from siblings like set_rules and verify_log.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or when-not-to-use guidance is provided. The purpose implies use for permission checking, but no alternatives or exclusions are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools