# analyze_python_ast

对 Python 代码做 AST 级别精确分析，比 grep 更准确。

Agent View of the PolicyLayer registry record for `analyze_python_ast`. HTML page: https://policylayer.com/tools/0xyubo-ripple-mcp/analyze-python-ast

## Facts

- Tool: `analyze_python_ast`
- Server: Ripple-MCP (`0xyubo/ripple-mcp`) — https://policylayer.com/tools/0xyubo-ripple-mcp.md
- Homepage: https://github.com/0xYubo/Ripple-Mcp
- Risk category: Read (Low risk)
- Registry record: grade B, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Allowed

## Example call (MCP tools/call, JSON-RPC 2.0)

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

## Why analyze_python_ast is rated Low

This tool retrieves and analyzes code structure through AST parsing. It performs static analysis comparable to linting or code inspection tools—examining code without executing it, modifying it, or triggering side effects. The context of a 'semantic change impact analysis MCP server' confirms this is part of a suite designed to understand code relationships, not alter them.

From the tool's own definition: "Tool performs 'AST 级别精确分析' (AST-level precise analysis) of Python code. The description indicates static code analysis with no capability to modify, execute, or delete code. The function is to analyze abstract syntax trees, which is a read-only operation."

## Use case

AI agents call analyze_python_ast to retrieve information from Ripple-MCP without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Ripple-MCP:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "analyze_python_ast": {}
  }
}
```

## Other tools on Ripple-MCP (5)

- `find_definition` — Read — https://policylayer.com/tools/0xyubo-ripple-mcp/find-definition.md
- `generate_impact_report` — Read — https://policylayer.com/tools/0xyubo-ripple-mcp/generate-impact-report.md
- `get_code_context` — Read — https://policylayer.com/tools/0xyubo-ripple-mcp/get-code-context.md
- `scan_patterns` — Read — https://policylayer.com/tools/0xyubo-ripple-mcp/scan-patterns.md
- `trace_callers` — Read — https://policylayer.com/tools/0xyubo-ripple-mcp/trace-callers.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=0xyubo-ripple-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/0xyubo-ripple-mcp
