appgrammar_decompile
Axiom: I — Compression | Category: Creation
This tool uses a multi-turn protocol. The initial call returns a prompt and token. Run the prompt on your LLM, then submit the structured output via appgrammar_tool_submit (or the tool-specific submit variant) to advance the operation.
Decompile an existing codebase into an appgrammar. Send a codebase snapshot and the server runs a 5-step reverse-analysis session to extract architecture, design system, task DAG, file registry, and enriched descriptions.
The output is a fully executable appgrammar identical in structure to one created by appgrammar_create. Use appgrammar_start to execute it.
Decompilation pipeline:
- Architecture extraction from source code
- Design system extraction from CSS/config
- Reconstruction task DAG
- File registry with exact exports
- Step enrichment with compressed specifications
Returns the first step prompt (architecture extraction) with codebase context embedded. Submit results via appgrammar_decompile_submit using the returned token.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
description | string | Yes | Brief description of the codebase being decompiled (minimum 10 characters). |
codebase_snapshot | object | Yes | Codebase snapshot containing: files (array of {path, content, language, size}), tree (directory tree string), optional package_json and tsconfig, total_files (positive integer), total_lines (non-negative integer). |
mode | "prototype" | "production" | No | Build mode for the resulting appgrammar. |
language | "typescript" | "python" | No | Primary programming language of the codebase. |
framework | string | No | Framework name detected in the codebase. |
database | "sqlite" | "postgresql" | "mysql" | "mongodb" | No | Database engine used by the codebase. |
Example
{
"method": "tools/call",
"params": {
"name": "appgrammar_decompile",
"arguments": {
"description": "A SaaS invoicing app with Stripe integration and PDF export",
"codebase_snapshot": {
"files": [
{
"path": "src/index.ts",
"content": "import express from \"express\";",
"language": "typescript",
"size": 30
}
],
"tree": "src/\n index.ts",
"total_files": 1,
"total_lines": 1
}
}
}
}