Skip to main content
Glama

HallucC — Hallucination & Safety Guardian

Audit CUA Code

check_cua_code_audit
Read-onlyIdempotent

CUA code audit: static analysis of agent source code that detects dangerous imports (subprocess, os.system, and similar), privilege boundaries (eval/exec), injection surface (string-concatenated shell commands), dangerous defaults, and missing sandboxing. Pure rule-based scanning: no LLM calls, no quota consumed. Supports single-file and multi-file scans.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "check_cua_code_audit"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeNoSingle-file mode: source code text to scan (up to 50,000 characters); mutually exclusive with files
filesNoMulti-file mode: array of [{path, content, language?}]; mutually exclusive with code
filenameNoSingle-file mode: filename used to identify the file in the report (default: input.py)
languageNoLanguage hint; with auto it is inferred from the filename extension (default: auto)

Output Schema

NameRequiredDescriptionDefault
summaryNo
findingsNo
disclaimerNo
privacy_noteNo
ruleset_versionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / code / description
      Previous value: -"单文件模式:要扫描的源代码文本(≤50000 字符),与 files 二选一"New value: +"Single-file mode: source code text to scan (up to 50,000 characters); mutually exclusive with files"
    • changedInput schema / properties / filename / description
      Previous value: -"单文件模式:文件名,用于报告中标识(默认 input.py)"New value: +"Single-file mode: filename used to identify the file in the report (default: input.py)"
    • changedInput schema / properties / files / description
      Previous value: -"多文件模式:[{path, content, language?}] 数组,与 code 二选一"New value: +"Multi-file mode: array of [{path, content, language?}]; mutually exclusive with code"
    • changedInput schema / properties / language / description
      Previous value: -"语言提示,auto 时按 filename 扩展名推断(默认 auto)"New value: +"Language hint; with auto it is inferred from the filename extension (default: auto)"
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "disclaimer": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "findings": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "additionalProperties": {},
      +            "properties": {
      +              "category": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "detail": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "file": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "line": {
      +                "anyOf": [
      +                  {
      +                    "maximum": 9007199254740991,
      +                    "minimum": -9007199254740991,
      +                    "type": "integer"
      +                  },
      +                  {
      +                    "type": "null"
      +                  }
      +                ]
      +              },
      +              "raw": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "severity": {
      +                "anyOf": [
      +                  {
      +                    "enum": [
      +                      "high",
      +                      "medium",
      +                      "low"
      +                    ],
      +                    "type": "string"
      +                  },
      +                  {
      +                    "type": "null"
      +                  }
      +                ]
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "privacy_note": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "ruleset_version": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "summary": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": {},
      +          "properties": {
      +            "by_category": {
      +              "anyOf": [
      +                {
      +                  "additionalProperties": {},
      +                  "propertyNames": {
      +                    "type": "string"
      +                  },
      +                  "type": "object"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "by_severity": {
      +              "anyOf": [
      +                {
      +                  "additionalProperties": {},
      +                  "propertyNames": {
      +                    "type": "string"
      +                  },
      +                  "type": "object"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "capability_level": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "dangerous_import_count": {
      +              "anyOf": [
      +                {
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "injection_surface_count": {
      +              "anyOf": [
      +                {
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "tool_count": {
      +              "anyOf": [
      +                {
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "total": {
      +              "anyOf": [
      +                {
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            }
      +          },
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds meaningful behavioral context beyond annotations: pure rule-based scanning, no LLM calls, no quota consumed, and support for single-file and multi-file modes. It does not describe all report details, but the output schema covers return values.

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

Conciseness4/5

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

The description is front-loaded with its purpose and then lists the categories of issues detected. It is efficient overall, though the opening 'CUA code audit:' slightly repeats the name/title. Every sentence contributes useful information without excessive length.

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

Completeness5/5

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

The tool has four fully described parameters, complete annotations, and an output schema, so the description does not need to explain return values or parameter syntax. It covers purpose, scanning categories, execution model, and supported input modes. Nothing essential for correct invocation is missing.

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 description coverage is 100%, so the schema already documents code, files, filename, and language semantics in detail. The description adds only a high-level note about single-file and multi-file scans, which does not meaningfully extend the schema's parameter documentation. Baseline 3 is appropriate because the schema carries the parameter burden.

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 states a specific verb and resource: static analysis of agent source code for dangerous imports, privilege boundaries, injection surface, dangerous defaults, and missing sandboxing. This clearly distinguishes it from sibling tools that appear to check actions, ice walls, or safety rather than source code. An agent can identify the tool's purpose without opening the schema.

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?

The description implies usage by saying it scans agent source code and supports single-file and multi-file scans. However, it gives no explicit when-to-use vs when-not-to-use guidance and does not name any alternative sibling tools. The context is clear enough for an agent to infer it should be used for source-code auditing, but explicit routing guidance is absent.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.