Agent Components
Browse the registry of harness components and read one component definition
Overview
Agent components are the harness components Closedloop discovers across your organization's compute targets: subagents, skills, commands, MCP servers, hooks, plugins, workflows, config, and built-in or orchestration tools. These tools let an MCP client list that registry with usage metrics and read one component's definition and version history.
| Tool | Purpose |
|---|---|
list-agent-components | List the registry with usage metrics, ownership, and provenance |
get-agent-component | Get one component by slug, with version history, provenance, and the sessions that invoked it |
Scope: both tools require the read scope. Both are read-only and scoped to your organization.
Errors: a failed call returns an MCP tool result with isError: true whose text gives a title, a description, any remediation steps, and the error's code, message, and timestamp. Input that fails the parameter schema is rejected by the MCP SDK before any API call.
List Agent Components
Tool: list-agent-components
Scope: read
Underlying API: GET /agent-components
The API pages and sorts the results. total and hasMore describe the whole matching set, so page with offset rather than re-slicing a page.
| Name | Type | Required | Description |
|---|---|---|---|
kinds | string[] | No | One or more of subagent, command, skill, workflow, mcp, hook, config, plugin, tool, orchestration. Omit (or pass an empty array) for every kind. |
collaborator | string | No | One collaborator (author) display name, matched against the component's authors (its discoverer plus editors). Rows with no recorded authors fall back to the owner of the compute target that observed them. |
owner | string | No | Deprecated alias for collaborator. When both are set, a non-blank collaborator wins. |
source | string | No | One source label: a pack name, repository, MCP server, or config scope. |
harness | "claude" | "codex" | "opencode" | "both" | No | One target harness. "both" selects components observed across more than one harness. |
search | string | No | Free-text filter over component names. |
startDate | string | No | ISO 8601 date or timestamp. Keeps components invoked on or after it (a usage window on lastInvokedAt). Components with no usage in the window are dropped. Omit for the all-time inventory. |
endDate | string | No | ISO 8601 date or timestamp. Keeps components invoked on or before it, on the same basis. |
sortBy | "name" | "type" | "metric" | "source" | "harness" | "invocations" | "sessions" | No | Sort column. |
sortDir | "asc" | "desc" | No | Sort direction. |
limit | integer | No | 1–100. When omitted, the API returns 50. |
offset | integer | No | 0–10000. Default 0. |
Returns:
{
"items": [
{
"id": "3f1c...-uuid",
"slug": "skill::code-review",
"name": "code-review",
"kind": "skill",
"sourceType": "...",
"source": "acme/agent-pack",
"harness": "claude",
"invocations": 412,
"sessions": 97,
"locPerDollar": 1830.5,
"owner": "Dana Lee",
"collaborators": [],
"computeTargetIds": ["..."],
"firstSeenAt": "2026-05-02T08:00:00.000Z",
"lastSeenAt": "2026-07-30T12:00:00.000Z",
"lastInvokedAt": "2026-07-29T16:41:00.000Z"
}
],
"returned": 1,
"total": 138,
"hasMore": true
}slug(kind::key) is the identifierget-agent-componenttakes.idis an internal row id and is not accepted there.locPerDollaris lines of code per dollar.lastSeenAtis refreshed by every inventory sync while a component stays installed, so it does not indicate use. UselastInvokedAtfor recency of use.- A field the API did not send, or sent with the wrong type, comes back as
null(collaboratorsandcomputeTargetIdscome back as[]).
Example:
list-agent-components(kinds: ["skill", "subagent"], sortBy: "invocations", sortDir: "desc", limit: 20)Get Agent Component
Tool: get-agent-component
Scope: read
Underlying API: GET /agent-components/{slug}
| Name | Type | Required | Description |
|---|---|---|---|
slug | string | Yes | The slug from list-agent-components, e.g. "skill::code-review". Pass it as is; the tool URL-encodes it. |
includePrompt | boolean | No | Include the definition text of the selected revision. Default false. |
promptMaxChars | integer | No | 200–120000. Maximum definition characters returned when includePrompt is true. Default 4000. Longer text is cut and ends with ...[truncated]. |
versionHash | string | No | A hash from versions, to select a historical revision instead of the current one. |
Returns every field of a list row, plus:
| Field | Meaning |
|---|---|
properties | Definition metadata from the API (for example path, format, model, and allowed tools), or null. |
promptLength | Character length of the selected revision's text. Always present, so you can size a read before asking for it. |
prompt, promptVersionHash | Present only when includePrompt is true: the (possibly truncated) definition text and the hash of the revision it came from. |
versions | Revision metadata: hash, source, format, createdAt, isCurrent, and contentLength. Revision text is never included here. The API returns at most 20 revisions. |
versionsTruncated | Present, and true, only when versions is partial. Its absence means the history is complete. |
provenance | Per-device provenance records from the API. |
usageSessions | The sessions that invoked the component, as the API returns them. |
The selected revision is the one matching versionHash, else the one marked isCurrent. If versionHash matches no revision in versions, the tool returns the component's top-level definition text instead, and promptVersionHash is null. Check promptVersionHash to confirm which revision you received.
Errors: 404 when no component with that slug exists in your organization.
Example:
# Size the definition first, then read it
get-agent-component(slug: "skill::code-review")
get-agent-component(slug: "skill::code-review", includePrompt: true, promptMaxChars: 20000)
# Read an earlier revision
get-agent-component(slug: "skill::code-review", includePrompt: true, versionHash: "<hash from versions>")For the sessions that run these components, see Agent Session Reporting.