Skip to content
NotHolyDocs

MCP

file_analyze

Static analysis of a sample, binary, document or script over MCP. What it detects and extracts, what it returns, the limits and the errors. Nothing in the file is executed.

View as Markdown

file_analyze takes one file and analyzes it statically in an isolated sandbox. Use it to triage a malware sample, a binary, an APK, a maldoc or a script before you open it in your own tools. Nothing in the file is executed at any step.

It is one of the tools on the remote and local MCP servers. The Research API runs the same analysis through POST /v1/files.

What it is for

  • For malware triage: hashes, entropy, a packed-payload flag, imported functions, capabilities inferred from those imports, known tradecraft strings and executables hidden inside other files.
  • For reverse engineering: with ELF and PE you get format, entry point, sections and imported functions. ELF, PE, Mach-O and DEX also get a disassembly preview of the first bytes and the printable strings. APK, JAR and other archives are walked entry by entry.
  • For phishing and maldocs: VBA macros come out as text, with auto-run and suspicious calls flagged. PDFs that list JavaScript are flagged. So are polyglots.
  • For code review and bug bounty: source files are scanned for dangerous sinks fed by input, such as SQL built by concatenation or a shell command with a variable, and for hardcoded credentials.

Every flag is a heuristic for you to check by hand.

How it works

  1. Your client sends the file. On the remote server you pass name and content_base64. With notholy mcp you pass a local path, and the CLI reads the file on your machine and sends it the same way.
  2. The server checks the size and your organization's upload slots, then stores the file encrypted at rest under your organization.
  3. A disposable sandbox parses the file. The sandbox has no network. The type comes from the file's bytes, not its name or extension.
  4. The parser's output is validated outside the sandbox. The extracted text is split into chunks and stored encrypted.
  5. The call returns when the analysis ends, with the file record and the first 20 chunks. If the analysis is still running after 80 seconds, the call returns the file record with status still processing, no chunks and a note, and the analysis carries on. Read the result with GET /v1/files/{id} on the Research API.

Nothing is executed

  • The file is parsed, never run. Binaries are never started, scripts are read as text, macros are extracted as text and Python pickles are disassembled without being loaded.
  • The sandbox has no network, so nothing in a file can call out.
  • Each analysis has its own time and memory limits. A file that hits one ends as rejected with a reason. It never runs longer or takes more memory.
  • What the parser returns is checked against a fixed schema before anything uses it.
  • The result reaches your model marked as untrusted outside data. If a file says "ignore your instructions", that text is content to analyze.

Supported types

kindFilesWhat you get
elf, peLinux and Windows executables and librariesSHA-256, entropy, format, entry point, sections, imported functions, capabilities, a disassembly preview and strings
macho, dexmacOS binaries, Android bytecodeSHA-256, entropy, a disassembly preview and strings
zip, tar, gzip, bzip2, xz, 7z, rarArchives, including .docx, .xlsx, .pptx, .jar and .apkEach entry goes through the same parsers, up to 3 levels deep, plus an index of entries. Office packages are marked office, macro-enabled ones (.docm, .xlsm, .pptm) get the macro scan, and APKs are marked android
oleLegacy .doc, .xls, .msiVBA macros as text, auto-run and suspicious keywords, strings
pdfPDFText per page, object and page counts, a flag when JavaScript is listed
textSource code, scripts, logs, configsThe text in 200-line chunks, with the code and credential scans
json, xml, html, svgStructured text and markupThe text. SVG with scripts or event handlers is flagged. DTDs and entities are never expanded
png, jpeg, gifImagesDimensions only. There is no OCR
picklePython picklesA pickletools disassembly. The pickle is never loaded
binaryAnything elseEntropy, the first 256 bytes as hex, and strings

The disassembly preview decodes the first 4 KB of the file as x86-64, up to 200 instructions. There is no decompiler.

What every file is scanned for

Findings land in file.warnings as short codes, with details in file.meta.

WarningMeaningDetails in meta
credentials_detectedAWS, GitHub, Slack, Google, SendGrid, Twilio or npm tokens, JWTs, bearer tokens, private keys or password assignmentscredential_kinds
code:<category>In source files and markup: sql_injection, command_injection, ssrf, path_traversal, code_execution, insecure_deserialization, remote_exec_download, weak_cryptocode_findings, one short evidence snippet per category
ioc:<name>Tradecraft strings: meterpreter, mimikatz, cobalt_strike, reverse_shell, powershell_encoded, lolbin_exec, persistence, ransom_destroy, sql_xp_cmdshell, webshellindicators
cap:<capability>In binaries, from the imported functions: process_injection, download_exec, anti_debug, keylogging, dynamic_api_resolution, persistence_registry, service_control, crypto, screen_capture, networkcapabilities
high_entropy_packedWhole-file entropy of 7.2 or more, typical of packed or encrypted payloadsentropy
embedded_executable, polyglotA second executable or container inside the fileembedded, with kind and offset
vba_macros_present, pdf_javascript_listed, svg_script_foundActive content in a document, extracted or listed, never runThe macro source is in the chunks
encrypted_entry, symlink_ignoredArchive entries that were skippedarchive_index
text_truncated, ocr_unavailable, pickle_not_loadedLimits of the analysis

Input

ArgumentWhereMeaning
content_base64Remote, requiredThe file in standard base64: A-Z, a-z, 0-9, + and /, padded with =. Line breaks are allowed. Anything else, such as a URL or URL-safe base64, is refused
nameRemote, optionalThe file name, up to 500 characters. A longer name is refused, never cut. Without name, the server uses the request's x-file-name header (URL-encoded for non-ASCII characters, with any path removed), and after that file. The type comes from the bytes. For plain text, the extension decides whether the source-code scan runs
pathLocal onlyA path on your machine. notholy mcp reads it and sends name and content_base64 for you

The remote server cannot read your disk, so path only works through notholy mcp.

Output

The result is JSON, returned as structuredContent.data and as text in content[0].text.

FieldMeaning
file.idThe file id
file.nameThe name you sent
file.statusready, or rejected with a reason. processing when the call returned before the analysis ended
file.reasonWhy it was rejected, or null
file.kindThe detected type, from the table above
file.size, file.sha256Size in bytes and the hash of the bytes you sent
file.warningsThe findings, as codes
file.metaDetails for the findings and the type: imports, sections, entropy, the disassembly preview, the archive index, page counts
file.expiresAtWhen the file expires, one hour after upload. It is deleted automatically after that
chunksThe first 20 chunks of extracted text, each with seq, locator and text
noteOnly when the call returned before the analysis ended: where to read the result

A chunk holds up to 4,000 characters. locator says where the text came from, for example file:lines 1-200, file:page 3, file#strings or a path inside an archive. A file yields up to 5 million characters of text. Past that, text_truncated is set.

MCP returns only the first 20 chunks. For the rest, read the same file id from the Research API with your API key: GET /v1/files/{id}/content?from=20&limit=200.

Example: remote

A small Python file with a SQL query built by concatenation, a shell command with request input and a hardcoded AWS key.

JSON
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "file_analyze",
    "arguments": {
      "name": "app.py",
      "content_base64": "aW1wb3J0IG9zCmZyb20gZmxhc2sgaW1wb3J0IHJlcXVlc3QKCmRlZiBnZXRfdXNlcihkYik6CiAgICB1aWQgPSByZXF1ZXN0LmFyZ3NbImlkIl0KICAgIHJldHVybiBkYi5leGVjdXRlKCJTRUxFQ1QgKiBGUk9NIHVzZXJzIFdIRVJFIGlkID0gIiArIHVpZCkKCmRlZiBwaW5nKCk6CiAgICBvcy5zeXN0ZW0oInBpbmcgLWMgMSAiICsgcmVxdWVzdC5hcmdzWyJob3N0Il0pCgpBV1NfS0VZID0gIkFLSUFJT1NGT0ROTjdFWEFNUExFIgo="
    }
  }
}

structuredContent.data in the response:

JSON
{
  "file": {
    "id": "file_01jd2m8k4q9x7c3v5b6n0p1r2s",
    "name": "app.py",
    "status": "ready",
    "reason": null,
    "kind": "text",
    "size": 245,
    "sha256": "13fa852e9d2b46f32120f01169d0dc0c9211871d6545124953d26f909b19d078",
    "warnings": ["code:code_execution", "code:command_injection", "code:sql_injection", "credentials_detected"],
    "meta": {
      "credential_kinds": ["aws_access_key"],
      "code_findings": [
        { "category": "code_execution", "evidence": "os.system(" },
        { "category": "command_injection", "evidence": "os.system(\"ping -c 1 \" + request." },
        { "category": "sql_injection", "evidence": "SELECT * FROM users WHERE id = \" + u" }
      ],
      "indicators": []
    },
    "expiresAt": "2026-11-21T15:04:05.000Z"
  },
  "chunks": [
    {
      "seq": 0,
      "locator": "file:lines 1-12",
      "text": "import os\nfrom flask import request\n\ndef get_user(db):\n    uid = request.args[\"id\"]\n    return db.execute(\"SELECT * FROM users WHERE id = \" + uid)\n\ndef ping():\n    os.system(\"ping -c 1 \" + request.args[\"host\"])\n\nAWS_KEY = \"AKIAIOSFODNN7EXAMPLE\"\n"
    }
  ]
}

Example: local

With notholy mcp, the client passes a path and the CLI does the encoding:

JSON
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": { "name": "file_analyze", "arguments": { "path": "./samples/app.py" } }
}

The response is the same as in the remote example. notholy mcp --security-data leaves file_analyze out, so a file only leaves your machine when you ask for it. Use plain notholy mcp to get it.

Limits

  • Size: up to 4 MB per call. file_analyze waits for the analysis, and the connection is closed after 100 seconds, so a larger file does not fit in one call and is refused with an error that says so. For files up to 32 MB, upload the raw bytes to POST /v1/files on the Research API without wait=1, then read GET /v1/files/{id} until status is ready or rejected.
  • Concurrent uploads: each organization has 20 upload slots and 400 MB in flight at once, shared with the chat and POST /v1/files. A slot is freed as soon as its analysis ends.
  • Archives: 3 levels of nesting, 10,000 entries, 2 GB expanded and a 100:1 expansion ratio. Entries over 32 MB are hashed but not parsed.
  • Documents: PDFs up to 2,000 pages and 200,000 objects, images up to 50 megapixels, JSON nested up to 128 levels.
  • Rate: MCP calls count against your organization's 120 calls a minute. Past that, the server answers HTTP 429 with a Retry-After header.

Retention and cost

The file and its extracted text are stored encrypted, scoped to your organization. Each file_analyze upload is deleted automatically one hour after upload, with its extracted text. To have one removed sooner, write to [email protected]. This is storage you ask for, separate from inference, which stores no content.

file_analyze needs credit on your account, like the other research tools. It does not use tokens.

file_analyze may be metered per file. When a price is set, each file is charged to your balance; a call that returns an error is not charged. The price, if any, is on the pricing page.

Errors

A file the parser cannot handle is a normal result: file.status is rejected, file.reason says why, and chunks is empty. Common reasons:

reasonWhat happened
nesting_limit, too_many_entries, entry_size_limit, extracted_size_limit, compression_ratio_limitAn archive went over a limit. A zip bomb stops here
zip_malformed, zip_overlapping_entries, tar_malformedA broken or crafted archive
pdf_malformed, pdf_too_many_pages, pdf_too_many_objects, pdf_reference_loopA broken, oversized or looping PDF
image_too_large, json_too_deepOver the image or JSON limit
parser_timeout, resource_limit, memory_limit, recursion_limit, output_too_largeThe analysis hit its time, memory or output limit
parser_crashed, invalid_parser_output, processing_failedThe parser failed on this file
sandbox_busy, sandbox_unavailableNo sandbox was free. Try again shortly

These come back as a JSON-RPC error with code -32602 (invalid params) instead of a result:

MessageCause
invalid params: content_base64 is requiredNo file was sent
invalid params: content_base64 is not valid base64…The content is not standard base64 with = padding
invalid params: name is … characters; the limit is 500The name is too long
invalid params: the file is … MB and file_analyze over MCP takes up to 4 MB…The file is over the per-call limit. Upload it with POST /v1/files

A call over the rate limit gets JSON-RPC error -32029, with rate limit: too many research calls this minute… as the message and the seconds to wait in data.retryAfter.

These come back as a tool error, with isError: true and the message as text:

MessageCause
too many uploads for this organization right now; try again shortlyAll of your organization's upload slots are in use
research tools need credit on the account…No credit on the account
tool failedAn unexpected failure. No internal detail is returned

Locally, notholy mcp answers with a JSON-RPC error when the path does not exist or the file is over 4 MB.

When to use it

  • file_analyze when you have the artifact: a sample, a binary, an APK, a document, a script, a bundle or a lockfile.
  • cke_search when you need method rather than evidence: how to test a weakness class, what an ATT&CK technique does, the right tool command. A common flow is file_analyze first, then cke_search for the techniques and weaknesses it flagged.
  • web_read when the thing you need is a public web page, such as an advisory, a writeup or patch notes. web_read reads pages and file_analyze reads files you hold.

Next