analyze_code_ast
Detect GDPR compliance issues in Python, JavaScript, and TypeScript by analyzing source code with AST parsing, identifying cross-border data transfers, PII mishandling, and logging violations.
Instructions
Analyze code using AST for GDPR compliance (Python, JavaScript, TypeScript).
AST analysis provides higher accuracy than regex by:
Filtering out comments and string literals (reducing false positives)
Tracking variable assignments and data flow
Identifying function definitions and call sites
Verifying semantic intent of GDPR-related code
Detects:
Cross-border data transfers (third-party API imports)
PII handling in function parameters
PII logging violations
DSR implementation patterns (Art. 15-22)
Args: code: Source code to analyze file_path: Optional file path for automatic language detection language: Override language (python, javascript, typescript) deep_analysis: Include detailed function, import, and data flow info
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "analyze_code_ast"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| file_path | No | ||
| language | No | ||
| deep_analysis | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |