Closedloop.ai
MCP Server

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.

ToolPurpose
list-agent-componentsList the registry with usage metrics, ownership, and provenance
get-agent-componentGet 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.

NameTypeRequiredDescription
kindsstring[]NoOne or more of subagent, command, skill, workflow, mcp, hook, config, plugin, tool, orchestration. Omit (or pass an empty array) for every kind.
collaboratorstringNoOne 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.
ownerstringNoDeprecated alias for collaborator. When both are set, a non-blank collaborator wins.
sourcestringNoOne source label: a pack name, repository, MCP server, or config scope.
harness"claude" | "codex" | "opencode" | "both"NoOne target harness. "both" selects components observed across more than one harness.
searchstringNoFree-text filter over component names.
startDatestringNoISO 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.
endDatestringNoISO 8601 date or timestamp. Keeps components invoked on or before it, on the same basis.
sortBy"name" | "type" | "metric" | "source" | "harness" | "invocations" | "sessions"NoSort column.
sortDir"asc" | "desc"NoSort direction.
limitintegerNo1–100. When omitted, the API returns 50.
offsetintegerNo0–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 identifier get-agent-component takes. id is an internal row id and is not accepted there.
  • locPerDollar is lines of code per dollar.
  • lastSeenAt is refreshed by every inventory sync while a component stays installed, so it does not indicate use. Use lastInvokedAt for recency of use.
  • A field the API did not send, or sent with the wrong type, comes back as null (collaborators and computeTargetIds come 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}

NameTypeRequiredDescription
slugstringYesThe slug from list-agent-components, e.g. "skill::code-review". Pass it as is; the tool URL-encodes it.
includePromptbooleanNoInclude the definition text of the selected revision. Default false.
promptMaxCharsintegerNo200–120000. Maximum definition characters returned when includePrompt is true. Default 4000. Longer text is cut and ends with ...[truncated].
versionHashstringNoA hash from versions, to select a historical revision instead of the current one.

Returns every field of a list row, plus:

FieldMeaning
propertiesDefinition metadata from the API (for example path, format, model, and allowed tools), or null.
promptLengthCharacter length of the selected revision's text. Always present, so you can size a read before asking for it.
prompt, promptVersionHashPresent only when includePrompt is true: the (possibly truncated) definition text and the hash of the revision it came from.
versionsRevision metadata: hash, source, format, createdAt, isCurrent, and contentLength. Revision text is never included here. The API returns at most 20 revisions.
versionsTruncatedPresent, and true, only when versions is partial. Its absence means the history is complete.
provenancePer-device provenance records from the API.
usageSessionsThe 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.

On this page