Skip to main content
Glama
renef-mcp
by Ahmeth4n

renef_kcov

Collect Linux kernel coverage with KCOV by starting, pausing, resetting, and reading recorded PCs or AFL-style edge hashes for dynamic analysis of Android ARM64 targets.

Instructions

Kernel coverage collection via Linux KCOV (KCov.* API; requires kernel CONFIG_KCOV=y).

Manages a session-wide _kcov handle in the target's Lua VM.

Actions:

  • start: Open /sys/kernel/debug/kcov with optional buf_size (default 256K entries) and enable recording

  • enable: Re-enable recording on the open _kcov handle

  • disable: Pause recording (buffer preserved for collect/edges)

  • count: Return number of recorded kernel PCs without copying

  • collect: Collect recorded kernel PC addresses (hex list, capped at max_entries)

  • edges: Compute AFL-style unique kernel edge hashes and total edge count

  • reset: Clear the KCOV buffer for a fresh measurement

  • stop: Disable and close the KCOV handle

Args: action: "start", "enable", "disable", "count", "collect", "edges", "reset", or "stop" buf_size: Number of PC entries for action="start" (0 = default 256K entries / 2MB) max_entries: Maximum PCs/edges returned in JSON (default: 256, max: 8192)

Returns: JSON object with coverage state or collected kernel PCs/edges

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": {
      "action": "<action>"
    },
    "name": "renef_kcov"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionYes
buf_sizeNo
max_entriesNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it discloses the `CONFIG_KCOV=y` prerequisite, the session-wide `_kcov` handle that persists across calls, the `/sys/kernel/debug/kcov` path opened by `start`, and that buffers survive `disable`. It omits privilege/mount requirements (debugfs usually needs root) and the error behavior of calling `collect`/`enable` before `start`.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with a one-line summary, then a scannable action list where each line earns its place by describing one behavior. The trailing 'Returns:' summary is largely redundant since an output schema exists, which is the only real waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a stateful, multi-action tool with an existing output schema, the description covers prerequisites, handle lifetime, per-action effects, and parameter limits. The only meaningful gap is the absence of preconditions and failure modes (permissions, missing debugfs mount, calling actions out of order).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and there are no enums in the schema, so the description must compensate, and it does: it enumerates all eight valid `action` strings, defines `buf_size` units and its 0 = default 256K entries / 2MB meaning, and gives both default and max for `max_entries`. This adds substantially more meaning than the bare integer-typed schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line gives a specific verb and resource ('Kernel coverage collection via Linux KCOV') plus the exact API surface (`KCov.*`), and the enumerated action list makes the scope unambiguous. No sibling in the provided catalog covers kernel coverage, so it is clearly distinguishable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The action list encodes a lifecycle with real usage guidance: `disable` is stated to preserve the buffer for `collect`/`edges`, and `reset` is described as the way to get 'a fresh measurement'. However, it never states when this tool should be chosen over alternatives or what to do if the session is not started, so it stops short of explicit when/when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.