# get_code_context

获取代码上下文，帮助判断命中处是否真正受变更影响。

Agent View of the PolicyLayer registry record for `get_code_context`. HTML page: https://policylayer.com/tools/0xyubo-ripple-mcp/get-code-context

## Facts

- Tool: `get_code_context`
- 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": "get_code_context",
    "arguments": {}
  }
}
```

## Why get_code_context is rated Low

This tool queries and retrieves code context information to support impact analysis. It performs lookups and retrieval of existing data without creating, modifying, deleting, or executing any operations. The low severity reflects that accessing code context poses minimal risk even if misused by an AI agent—it only reads and displays information relevant to understanding code dependencies.

From the tool's own definition: "Tool name 'get_code_context' and description indicating it retrieves code context to determine if changes affect specific locations."

## Use case

AI agents call get_code_context 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": {
    "get_code_context": {}
  }
}
```

## Other tools on Ripple-MCP (5)

- `analyze_python_ast` — Read — https://policylayer.com/tools/0xyubo-ripple-mcp/analyze-python-ast.md
- `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
- `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
