Skip to main content
Glama

Analyze code

analyze
Read-onlyIdempotent

Runs the open-source hefesto-ai engine (hefesto analyze --no-config, free tier) on the files you send to the hosted analyzer and returns its findings: rule id, severity, file, line, message and the SARIF hefestoFingerprint/v1 fingerprint (format "sarif" adds the full SARIF 2.1.0 log). Use it to check a file or snippet the user shares (for example "analyze this file") for security and quality issues before committing. Try it: {"code":"password = "Sup3rS3cret!2026""} returns a HARDCODED_SECRET finding. Minimum call: {"code": ""}. Add path (e.g. "app/run.py") so the language comes from the extension; without path or language the language is inferred from the content, else python. For several files send files=[{"path", "content"}] instead. severity and format are optional. Covers Python, COBOL, the DevOps/IaC formats hefesto analyze routes, and TypeScript, JavaScript, Java, Go, Rust and C# through the multilang tree-sitter grammars (the first such request on a fresh server instance downloads the grammars and can take a few seconds longer). Limits: 20 files, 100 KB per file, 256 KB in total, 20 seconds, 10 requests per minute per IP, shared across server instances. No .hefesto.yaml is read. Files are deleted after the run; nothing is stored. For a whole repository, run hefesto analyze . locally.

Input Schema

NameRequiredDescriptionDefault
codeNoContents of one file or snippet, used when files is omitted. At most 100 KB. This is the only argument a first call needs.
pathNoOptional file name for code, e.g. "app/run.py" or "Dockerfile". The extension picks the language. Same rules as files[].path. Ignored when files is set.
filesNoSeveral files to analyze. Used instead of code when present. path: relative POSIX, at most 200 characters and 8 levels; each segment is letters, digits, "_", "." or "-" and must not start with "-"; no "..", no absolute paths, no ".git" or ".hefesto.yaml". content: UTF-8 text, no NUL bytes, at most 100 KB.
formatNoOptional. json (default): findings only; sarif: also the full SARIF 2.1.0 log.
languageNoOptional language of code. Ignored when files or path is set. When omitted it is inferred from the content (python if unsure). An unknown language is rejected; send path or files instead.
severityNoOptional minimum severity to report (default LOW).

Output Schema

NameRequiredDescriptionDefault
okYestrue when the engine returned analyzed: true.
errorNoFailure code when ok is false. invalid_json when the analyzer body was not JSON.
messageNoSame string as content[0].text when ok is false.
analysisNoAnalyzer JSON. The content text is a one-line summary plus this object.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / examples
      Previous value: -[
      -  {
      -    "code": "import subprocess\n\ndef run(cmd):\n    return subprocess.call(cmd, shell=True)\n"
      -  },
      -  {
      -    "code": "import subprocess\n\ndef run(cmd):\n    return subprocess.call(cmd, shell=True)\n",
      -    "path": "app/run.py",
      -    "severity": "MEDIUM"
      -  },
      -  {
      -    "files": [
      -      {
      -        "content": "import subprocess\n\ndef run(cmd):\n    return subprocess.call(cmd, shell=True)\n",
      -        "path": "src/run.py"
      -      }
      -    ]
      -  }
      -]New value: +[
      +  {
      +    "code": "import sqlite3\n\npassword = \"Sup3rS3cret!2026\"\n\n\ndef find_user(db, name):\n    return db.execute(\"SELECT * FROM users WHERE name = '\" + name + \"'\")\n"
      +  },
      +  {
      +    "code": "import sqlite3\n\npassword = \"Sup3rS3cret!2026\"\n\n\ndef find_user(db, name):\n    return db.execute(\"SELECT * FROM users WHERE name = '\" + name + \"'\")\n",
      +    "path": "app/users.py",
      +    "severity": "MEDIUM"
      +  },
      +  {
      +    "files": [
      +      {
      +        "content": "import sqlite3\n\npassword = \"Sup3rS3cret!2026\"\n\n\ndef find_user(db, name):\n    return db.execute(\"SELECT * FROM users WHERE name = '\" + name + \"'\")\n",
      +        "path": "src/users.py"
      +      }
      +    ]
      +  }
      +]
  2. Changed9 schema fields changed
    • changedInput schema / description
      Previous value: -"Provide files, or code (language optional, default python). severity and format are optional."New value: +"Send code (one file; path and language optional) or files (several). Everything else is optional."
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "code": "import subprocess\n\ndef run(cmd):\n    return subprocess.call(cmd, shell=True)\n"
      +  },
      +  {
      +    "code": "import subprocess\n\ndef run(cmd):\n    return subprocess.call(cmd, shell=True)\n",
      +    "path": "app/run.py",
      +    "severity": "MEDIUM"
      +  },
      +  {
      +    "files": [
      +      {
      +        "content": "import subprocess\n\ndef run(cmd):\n    return subprocess.call(cmd, shell=True)\n",
      +        "path": "src/run.py"
      +      }
      +    ]
      +  }
      +]
    • changedInput schema / properties / code / description
      Previous value: -"A single snippet, used only when files is omitted (written as e.g. snippet.py for language python). At most 100 KB."New value: +"Contents of one file or snippet, used when files is omitted. At most 100 KB. This is the only argument a first call needs."
    • changedInput schema / properties / files / description
      Previous value: -"Files to analyze. Used instead of code when present. path: relative POSIX, at most 200 characters and 8 levels; each segment is letters, digits, \"_\", \".\" or \"-\" and must not start with \"-\"; no \"..\", no absolute paths, no \".git\" or \".hefesto.yaml\". content: UTF-8 text, no NUL bytes, at most 100 KB."New value: +"Several files to analyze. Used instead of code when present. path: relative POSIX, at most 200 characters and 8 levels; each segment is letters, digits, \"_\", \".\" or \"-\" and must not start with \"-\"; no \"..\", no absolute paths, no \".git\" or \".hefesto.yaml\". content: UTF-8 text, no NUL bytes, at most 100 KB."
    • changedInput schema / properties / files / items / properties / path / description
      Previous value: -"Relative POSIX path."New value: +"Relative POSIX path. The extension picks the language."
    • changedInput schema / properties / format / description
      Previous value: -"json (default): findings only; sarif: also the full SARIF 2.1.0 log."New value: +"Optional. json (default): findings only; sarif: also the full SARIF 2.1.0 log."
    • changedInput schema / properties / language / description
      Previous value: -"Language of code when files is omitted. Default python. Ignored when files is set. An unknown language is rejected; send files instead."New value: +"Optional language of code. Ignored when files or path is set. When omitted it is inferred from the content (python if unsure). An unknown language is rejected; send path or files instead."
    • addedInput schema / properties / path
      Added value: +{
      +  "description": "Optional file name for code, e.g. \"app/run.py\" or \"Dockerfile\". The extension picks the language. Same rules as files[].path. Ignored when files is set.",
      +  "type": "string"
      +}
    • changedInput schema / properties / severity / description
      Previous value: -"Minimum severity to report (default LOW)."New value: +"Optional minimum severity to report (default LOW)."
  3. Changed1 schema field changed
    • changedOutput schema / description
      Previous value: -"ok true carries the hosted analyzer body in analysis. ok false carries error and message. On success the content text is the summary, the analyzer JSON, and one PRO price line. On failure the content text is the error sentence only."New value: +"ok true carries the hosted analyzer body in analysis. ok false carries error and message. On success the content text is the summary and the analyzer JSON. On failure the content text is the error sentence only."
  4. Changed1 schema field changed
    • changedOutput schema / description
      Previous value: -"ok true carries the hosted analyzer body in analysis. ok false carries error and message. The content text is unchanged either way."New value: +"ok true carries the hosted analyzer body in analysis. ok false carries error and message. On success the content text is the summary, the analyzer JSON, and one PRO price line. On failure the content text is the error sentence only."
  5. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "allOf": [
      +    {
      +      "if": {
      +        "properties": {
      +          "ok": {
      +            "const": true
      +          }
      +        },
      +        "required": [
      +          "ok"
      +        ],
      +        "type": "object"
      +      },
      +      "then": {
      +        "required": [
      +          "ok",
      +          "analysis"
      +        ]
      +      }
      +    },
      +    {
      +      "if": {
      +        "properties": {
      +          "ok": {
      +            "const": false
      +          }
      +        },
      +        "required": [
      +          "ok"
      +        ],
      +        "type": "object"
      +      },
      +      "then": {
      +        "required": [
      +          "ok",
      +          "error",
      +          "message"
      +        ]
      +      }
      +    }
      +  ],
      +  "description": "ok true carries the hosted analyzer body in analysis. ok false carries error and message. The content text is unchanged either way.",
      +  "properties": {
      +    "analysis": {
      +      "additionalProperties": true,
      +      "description": "Analyzer JSON. The content text is a one-line summary plus this object.",
      +      "properties": {
      +        "analyzed": {
      +          "description": "true on this branch.",
      +          "type": "boolean"
      +        },
      +        "engine": {
      +          "additionalProperties": true,
      +          "type": "object"
      +        },
      +        "findings": {
      +          "items": {
      +            "additionalProperties": true,
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "stored": {
      +          "description": "false. Nothing is stored.",
      +          "type": "boolean"
      +        },
      +        "summary": {
      +          "additionalProperties": true,
      +          "properties": {
      +            "critical": {
      +              "type": "number"
      +            },
      +            "files_analyzed": {
      +              "type": "number"
      +            },
      +            "files_received": {
      +              "type": "number"
      +            },
      +            "high": {
      +              "type": "number"
      +            },
      +            "low": {
      +              "type": "number"
      +            },
      +            "medium": {
      +              "type": "number"
      +            },
      +            "total_issues": {
      +              "type": "number"
      +            }
      +          },
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "analyzed",
      +        "summary",
      +        "findings",
      +        "stored"
      +      ],
      +      "type": "object"
      +    },
      +    "error": {
      +      "description": "Failure code when ok is false. invalid_json when the analyzer body was not JSON.",
      +      "type": "string"
      +    },
      +    "message": {
      +      "description": "Same string as content[0].text when ok is false.",
      +      "type": "string"
      +    },
      +    "ok": {
      +      "description": "true when the engine returned analyzed: true.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  6. Changed10 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / description
      Added value: +"Provide files, or code (language optional, default python). severity and format are optional."
    • changedInput schema / properties / code / description
      Previous value: -"A single snippet, used when files is not given (written as e.g. snippet.py for language python)."New value: +"A single snippet, used only when files is omitted (written as e.g. snippet.py for language python). At most 100 KB."
    • changedInput schema / properties / files / description
      Previous value: -"Files to analyze. path: relative POSIX path (letters, digits, '_', '.', '-'; no '..', no absolute paths); content: UTF-8 text."New value: +"Files to analyze. Used instead of code when present. path: relative POSIX, at most 200 characters and 8 levels; each segment is letters, digits, \"_\", \".\" or \"-\" and must not start with \"-\"; no \"..\", no absolute paths, no \".git\" or \".hefesto.yaml\". content: UTF-8 text, no NUL bytes, at most 100 KB."
    • addedInput schema / properties / files / items / additionalProperties
      Added value: +false
    • addedInput schema / properties / files / items / properties / content / description
      Added value: +"UTF-8 source text. At most 100 KB. No NUL bytes."
    • addedInput schema / properties / files / items / properties / path / description
      Added value: +"Relative POSIX path."
    • changedInput schema / properties / language / description
      Previous value: -"Language of code: python (default), cobol, yaml, dockerfile, terraform, shell, sql, javascript, typescript, java, go, rust, csharp."New value: +"Language of code when files is omitted. Default python. Ignored when files is set. An unknown language is rejected; send files instead."
    • addedInput schema / properties / language / enum
      Added value: +[
      +  "python",
      +  "py",
      +  "cobol",
      +  "yaml",
      +  "yml",
      +  "dockerfile",
      +  "docker",
      +  "terraform",
      +  "hcl",
      +  "shell",
      +  "bash",
      +  "sh",
      +  "sql",
      +  "javascript",
      +  "js",
      +  "typescript",
      +  "ts",
      +  "java",
      +  "go",
      +  "rust",
      +  "csharp",
      +  "c#"
      +]
    • removedInput schema / required
      Removed value: -[]
  7. Changed5 schema fields changed
    • changedInput schema / properties / code / description
      Previous value: -"Ignored. Accepted for backward compatibility; run hefesto analyze locally to analyze code."New value: +"A single snippet, used when files is not given (written as e.g. snippet.py for language python)."
    • addedInput schema / properties / files
      Added value: +{
      +  "description": "Files to analyze. path: relative POSIX path (letters, digits, '_', '.', '-'; no '..', no absolute paths); content: UTF-8 text.",
      +  "items": {
      +    "properties": {
      +      "content": {
      +        "type": "string"
      +      },
      +      "path": {
      +        "maxLength": 200,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "path",
      +      "content"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 20,
      +  "type": "array"
      +}
    • addedInput schema / properties / format
      Added value: +{
      +  "description": "json (default): findings only; sarif: also the full SARIF 2.1.0 log.",
      +  "enum": [
      +    "json",
      +    "sarif"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / language / description
      Previous value: -"Ignored. Accepted for backward compatibility."New value: +"Language of code: python (default), cobol, yaml, dockerfile, terraform, shell, sql, javascript, typescript, java, go, rust, csharp."
    • addedInput schema / properties / severity
      Added value: +{
      +  "description": "Minimum severity to report (default LOW).",
      +  "enum": [
      +    "LOW",
      +    "MEDIUM",
      +    "HIGH",
      +    "CRITICAL"
      +  ],
      +  "type": "string"
      +}
  8. Changed3 schema fields changed
    • changedInput schema / properties / code / description
      Previous value: -"Code snippet to analyze"New value: +"Ignored. Accepted for backward compatibility; run hefesto analyze locally to analyze code."
    • changedInput schema / properties / language / description
      Previous value: -"Programming language (python, javascript, etc)"New value: +"Ignored. Accepted for backward compatibility."
    • changedInput schema / required
      Previous value: -[
      -  "code"
      -]New value: +[]
  9. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare read-only, non-destructive, idempotent behavior, and the description adds substantial context: hosted analyzer, free tier, no .hefesto.yaml read, files deleted after the run, no storage, rate limits, and first-request grammar download latency. This is rich behavioral disclosure beyond structured fields.

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 long but warranted for a tool with many constraints, and it front-loads purpose and key usage. Some details duplicate schema descriptions, but the sentences generally earn their place.

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?

Complete for a complex hosted analysis tool: it covers limits, supported languages, output modes, privacy behavior, and the local alternative. With an output schema and annotations also present, nothing critical is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already documents all parameters. The description still adds practical semantics: path extension drives language, language is inferred from content with python fallback, files replaces code, and severity/format are optional.

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?

States a specific action (runs the hefesto-ai engine on submitted code) and concrete outputs (rule id, severity, file, line, message, SARIF fingerprint), with an example invocation. It is unmistakably a code-analysis tool rather than compare, install, or pricing.

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

Usage Guidelines5/5

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

Explicitly says to use it for a file or snippet a user shares before committing, gives the minimum call and example, and directs whole-repository analysis to the local CLI. It also distinguishes code vs files and notes which parameters are optional.

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.