# get_diff_stats

Get diff statistics (files changed, lines added/removed)

Agent View of the PolicyLayer registry record for `get_diff_stats`. HTML page: https://policylayer.com/tools/agentics-ai-code-mcp/get-diff-stats

## Facts

- Tool: `get_diff_stats`
- Server: Code MCP Server (`agentics-ai/code-mcp`) — https://policylayer.com/tools/agentics-ai-code-mcp.md
- Homepage: https://github.com/agentics-ai/code-mcp
- Risk category: Read (Low risk)
- Registry record: grade F, 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_diff_stats",
    "arguments": {}
  }
}
```

## Why get_diff_stats is rated Low

This tool retrieves diff statistics—a form of data querying with no side effects. It computes and returns information about what changed (file count, line counts) without creating, modifying, deleting, executing, or moving resources. The read-only nature and lack of side effects place it firmly in the Read category with low severity, as misuse would only expose code change metadata, not cause harm.

From the tool's own definition: "Tool name 'get_diff_stats' and description 'Get diff statistics (files changed, lines added/removed)' indicate a read-only query operation that retrieves and summarizes metadata about code changes without modifying data."

## Use case

AI agents call get_diff_stats to retrieve information from Code MCP Server 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 Code MCP Server:

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

## Other tools on Code MCP Server (72)

- `delete_file` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/delete-file.md
- `docker_cleanup` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/docker-cleanup.md
- `docker_containers` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/docker-containers.md
- `remove_allowed_command` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/remove-allowed-command.md
- `rollback_session` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/rollback-session.md
- `docker_build` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-build.md
- `docker_compose` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-compose.md
- `docker_images` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-images.md
- `docker_networks` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-networks.md
- `docker_run` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-run.md
- `docker_system` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-system.md
- `docker_volumes` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-volumes.md
- `git_push` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/git-push.md
- `install_dependencies` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/install-dependencies.md
- `npm_command` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/npm-command.md
- `pip_install` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/pip-install.md
- `run_command` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-command.md
- `run_custom_tool` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-custom-tool.md
- `run_javascript` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-javascript.md
- `run_python` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-python.md
- `run_tests` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-tests.md
- `secure_run_command` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/secure-run-command.md
- `secure_run_command_sequence` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/secure-run-command-sequence.md
- `start_coding_session` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/start-coding-session.md
- `start_server` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/start-server.md
- `stop_server` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/stop-server.md
- `end_coding_session` — Other — https://policylayer.com/tools/agentics-ai-code-mcp/end-coding-session.md
- `analyze_code` — Read — https://policylayer.com/tools/agentics-ai-code-mcp/analyze-code.md
- `analyze_file_differences` — Read — https://policylayer.com/tools/agentics-ai-code-mcp/analyze-file-differences.md
- `compare_commits` — Read — https://policylayer.com/tools/agentics-ai-code-mcp/compare-commits.md
- …and 42 more: https://policylayer.com/tools/agentics-ai-code-mcp.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=agentics-ai-code-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/agentics-ai-code-mcp
