# Agent profiles tools

Base product reference. Discover the live schema before a call; project, role and release settings can change availability.

## agents\_attach\_documents

Attach existing Knowledge Base documents to an agent profile as business context, each with an optional note on when to read it, or take them off, when the user asks (e.g. "add the Cloud SQL runbook to the Payments engineer profile, to read before changing database settings"). Find document ids with knowledge\_list\_documents or knowledge\_search. Each document must be one the user can read in the profile's project; the profile must be in the user's active project (use\_project to switch). The profile's other context sources stay as they are, and calling again with the same documents changes nothing. A curated profile (readOnly) is refused (library\_read\_only). Saved at once when the user may edit the profile, or when their project doesn't require approval: the answer gives the profile's new version and the documents now on it. Otherwise the change waits under To be Approved (status "pending\_review"). Someone else's personal profile only its owner changes: that is refused (forbidden), not proposed. Attaching stores only the reference and note: whoever loads the profile is told to read each document with knowledge\_get\_document when its note applies; the text is never copied into the profile.

```ts
declare const tools: { mcp__MassifyAI__agents_attach_documents(args: {
  // Documents to attach; one already attached gets this note (none: its note is removed)
  attach?: Array<{ documentId: string; note?: string; }>;
  // Documents to take off the profile; one that isn't on it is ignored
  detach?: Array<string>;
  // The profile's id, when you have it
  id?: string;
  // Or its exact name, matched without regard to case
  name?: string;
}): Promise<CallToolResult>; };
```

## agents\_attach\_session

Attach a recorded session (or a period of it) to an agent profile as business context, when the user asks (e.g. "add the refund-outage session to our billing profile"). A curated profile (readOnly) is refused (library\_read\_only): it is read-only. Anyone who loads the profile can then read it. The session must be shared with the profile's project first: if it is the user's own, share it with sessions\_share, then attach. Attaching a session already attached replaces its period and note (leave from/to out for the whole session). Saved at once when the user may edit the profile, or when their project doesn't require approval; otherwise sent to the org admin as a proposed change. Someone else's personal profile only its owner changes: that is refused (forbidden), not proposed.

```ts
declare const tools: { mcp__MassifyAI__agents_attach_session(args: {
  // Only the part of the session from this time (ISO 8601)
  from?: string;
  // The profile's id, when you have it
  id?: string;
  // Or its exact name, matched without regard to case
  name?: string;
  // Why it matters to this profile, e.g. "how we fixed the refund webhook"
  note?: string;
  // Session Records' id for the session, from sessions_list or sessions_search
  sessionId: string;
  // Only the part of the session up to this time (ISO 8601)
  to?: string;
}): Promise<CallToolResult>; };
```

## agents\_install

Put an agent profile to work beyond this session, when the user asks (e.g. "always use the Code reviewer profile in this repo", "install the Payments engineer profile"). mode "live": a short block in this repo's AGENTS.md and CLAUDE.md makes every new session load the profile live, so it stays current. mode "snapshot": its instructions go into those files and each skill into its own SKILL.md, in this repo (scope "repo") or the user's home folder for every project (scope "user"); it works offline but does not update itself. ("always" and "copy" still work, as old names of live and snapshot.) The answer's mode and staysCurrent say which it is. Returns the files to write and the skills to install with skills\_install (each skill's whole folder); you write and install them, then tell the user what you wrote, with a link to the profile (consolePath, which the hub turns into consoleUrl). Give the profile's id or exact name, and for scope repo this repository's owner/name (from its git remote) or folder name.

```ts
declare const tools: { mcp__MassifyAI__agents_install(args: {
  // The profile's id, when you have it
  id?: string;
  // live: every session in this repo loads the profile at its start, so it stays current; snapshot: its instructions and skills are written into files, which work offline but do not update
  mode: "live" | "snapshot" | "always" | "copy";
  // Or its exact name (install only)
  name?: string;
  // For scope repo: this repository's owner/name (from its git remote), or its folder name
  repo?: string;
  // repo: this repository's AGENTS.md, CLAUDE.md and .claude/skills; user: the user's home folder, for every project (snapshot only)
  scope?: "repo" | "user";
}): Promise<CallToolResult>; };
```

## agents\_list

The agent profiles you may see, newest first, or, given a query, the ones that match it, best first: id, name, specialty, status, mode, runners and visibility ("personal": only its owner, their Team Lead and the org admin see it; "project": everyone in its project; null: a curated profile, or a profile with no owner left) and readOnly (true: a curated profile, which nobody changes; to change one, create a profile from it in the console) — enough to pick one for agents\_load. Same visibility as the console's Agent Profiles page, including the curated profiles.

```ts
declare const tools: { mcp__MassifyAI__agents_list(args: {
  limit?: number;
  // What the profile is for, in the user's words ("someone to review my PR"): the matching profiles, best match first, by name, specialty and instructions and by meaning, as the console's search finds them. Omit for every profile, newest first.
  query?: string;
}): Promise<CallToolResult>; };
```

## agents\_load

Load one agent profile to work as: its instructions (systemMessage), specialty, the business-context sources it should consult, the runners it is meant for, and the ids and pinned versions of the skills attached to it, plus howToUse, which says what to do next. Give the id or the exact name (agents\_list lists them). Load the attached skills yourself through the skills MCP (skills\_load) — this tool returns their ids, never their bodies. Only profiles you may see over the console are visible here; anything else answers not\_found. readOnly true means a curated profile: nobody changes it; to change it, the user copies it with Create from template.

```ts
declare const tools: { mcp__MassifyAI__agents_load(args: {
  // The profile's id, when you have it
  id?: string;
  // Or its exact name, matched without regard to case
  name?: string;
  // The repository this session works in, as owner/repo or its URL, when you know it
  repo?: string;
}): Promise<CallToolResult>; };
```

## agents\_save

Create agent profiles and skills — new ones, or updates to existing ones — from this coding session, from repositories, or both, saved as if the user had made them in the console. Use it when the user asks for this in any words, e.g. "create an agent profile from this session", "create an agent profile for these repos: acme/payments, acme/api", "extract skills from this session for handling webhook retries", "update the Code reviewer profile from this session", "update the SQL migration skill with what we learned". FROM A SESSION: draft from what this conversation showed works — the steps, checks and pitfalls a teammate would reuse — not a summary of the transcript; if the user adds "for X", keep only what helps with X. Set origin "session" and leave repos empty unless the work was in a repo you can name. FROM REPOS: read each where it already is on this machine; otherwise make a shallow, read-only clone into a temporary folder with the user's own git access, never install, build or run anything, and delete the clone afterwards. Draft from the repo's own instruction files first — CLAUDE.md, AGENTS.md, .cursor/rules, .claude/skills/\*/SKILL.md, Copilot instructions — with origin "file"; if a repo has none, draft from the code (build and test commands, layout, conventions you can see) with origin "code". One profile per repo unless the user asks for one covering several (then list all their repos, and give each skill the repo it came from), or for several roles in one repo: give each role its own name, since a new draft updates the user's existing profile only when both its name and a repo match. List any repo you could not read under unreadable with the reason. SKILLS: reuse before you write. When creating or updating a profile, first search the Skill Center (skills\_find\_for\_task) for its specialty, repos and the work it does, and attach each existing skill that fits as it is (skillId alone). Draft a new skill only for what no existing one covers: one SKILL.md with name/description frontmatter, one reusable technique. If a similar skill exists but is missing what this session taught, send an update to it instead of a new one (its skillId, the full new content and a one-line changeNote). Skills that belong to no profile go under skills. UPDATING A PROFILE: give its profileId (agents\_list, or the one loaded in this session) and the full new instructions. A curated profile (readOnly: true) can't be updated, by anyone: say so, and offer a new profile of the user's own instead (no profileId). Someone else's profile is updated at once where the user's project doesn't require approval, and otherwise waits under To be Approved, where an approver sees the before/after. To only add skills to a profile ("add the \<skill> skill to the \<profile> profile"), give its profileId and name, leave instructions empty, and list the skills (skillId from skills\_find\_for\_task); its instructions stay as they are. New profiles are project profiles, seen by everyone in the user's project; set visibility "personal" when the user wants them just for themselves ("just for me", "private", "my profile"): those are created at once and only they (with their Team Lead and the org admin) see them. A personal draft updates only the user's own personal profile, never a project one: if its name is taken by their project profile for the same repo, it is refused (name\_taken\_by\_team\_profile). Each saved profile says whether it is new or updated and its visibility. The skills it saves are project skills, seen by everyone in the user's project, whatever the profiles' visibility; for a personal skill use skills\_save. Send drafts only, never source code, secrets, tokens or customer data. The call saves them at once, by the same rules as the console: what the user may create is created; what needs approval in their project waits under To be Approved. Nothing is kept as a draft: if something can't be saved (status "not\_saved"), nothing else is either, and reasons says why — fix it (e.g. rename what clashes) and send again with a new captureId; attach any skill already written (written.skills) by its skillId rather than sending it again. Tell the user what the result says. Each saved profile and skill, and each profile sent for approval, has a consolePath, which the hub turns into consoleUrl: show it to the user as a link. The status is one of: "saved" (what was saved, and what was sent for approval); "not\_saved" (nothing more was saved: fix what reasons says and send again with a new captureId); "saving" (another call with this captureId is still saving them: call again with the same captureId in 2 minutes); "discarded" (these drafts were closed without being saved: send them again with a new captureId). Reuse a captureId only to retry the identical drafts after a dropped connection.

```ts
declare const tools: { mcp__MassifyAI__agents_save(args: { captureId: string; profiles?: Array<{ instructions?: string; instructionsOrigin: "file" | "code" | "session"; instructionsSources?: Array<string>; name: string; profileId?: string; repos?: Array<string>; skills?: Array<{ changeNote?: string; content?: string; name: string; origin: "file" | "code" | "session"; repo?: string; skillId?: string; sourcePath?: string; tags?: Array<string>; }>; specialty?: string; }>; skills?: Array<{ changeNote?: string; content?: string; name: string; origin: "file" | "code" | "session"; repo?: string; skillId?: string; sourcePath?: string; tags?: Array<string>; }>; unreadable?: Array<{ reason: string; repo: string; }>; userRequested: true; visibility?: "personal" | "project" | "team"; }): Promise<CallToolResult>; };
```

## agents\_set\_curated\_hidden

Disable every curated agent profile (readOnly) in a project, or enable them again, when the user asks: "disable curated agent profiles in Payments" (or "starter profiles", or "hide…"), "start from scratch with no curated profiles here". project is "current" (this session's, the default) or another project's id or name. Disabled curated profiles are not listed by agents\_list or on the Agent Profiles page, not offered as templates and not suggested in that project; other projects still see them, and one loaded by id or name (agents\_load, an install) still loads. Curated skills are separate (skills\_set\_curated\_hidden). Curated profiles disabled one by one stay disabled when this is turned off. Anyone who can edit the project may switch it. Answers \{ project: \{ id, name (with its team where the name repeats) \}, hidden, curatedProfiles (how many this disables there), changed (false when it already was so), note \}. Refusals say why: forbidden (a viewer there, or a service token), not\_found (no such project for the user), ambiguous (a name that repeats), unavailable (try again).

```ts
declare const tools: { mcp__MassifyAI__agents_set_curated_hidden(args: {
  // true disables every curated profile there; false enables them again
  hidden: boolean;
  // "current" (this session's project, the default), or a project's id, its name, or "Team / Project" when a name repeats
  project?: string;
}): Promise<CallToolResult>; };
```

## agents\_set\_visibility

Make an agent profile personal or a project profile, when the user asks (e.g. "make my billing profile personal", "share my reviewer profile with the project"). A curated profile (readOnly) is refused (library\_read\_only). Personal: only its owner, their Team Lead and the org admin see it, and it is shared with no other project. Project: everyone in its project sees it ("team" still works, as its old name). Only the profile's owner (in its project) or the org admin may switch it. Making it personal happens at once. Making it a project profile happens at once for a Team Lead or the org admin, or where the user's project doesn't require approval; otherwise it waits for approval under To be Approved (status "pending\_review") and stays personal until then. Tell the user what status and visibility say, with a link to the profile (consolePath, which the hub turns into consoleUrl).

```ts
declare const tools: { mcp__MassifyAI__agents_set_visibility(args: {
  // The profile's id (agents_list)
  id: string;
  // personal: only its owner (with their Team Lead and the org admin) sees it; project: everyone in its project
  visibility: "personal" | "project" | "team";
}): Promise<CallToolResult>; };
```

## agents\_uninstall

Undo agents\_install, when the user asks (e.g. "stop loading the Code reviewer profile in this repo", "uninstall the Payments engineer profile"). Give the profile's id, and the same mode, scope and repo it was installed with. Returns the blocks and folders to remove; you remove exactly those and tell the user.

```ts
declare const tools: { mcp__MassifyAI__agents_uninstall(args: {
  // The profile's id, when you have it
  id?: string;
  // live: every session in this repo loads the profile at its start, so it stays current; snapshot: its instructions and skills are written into files, which work offline but do not update
  mode: "live" | "snapshot" | "always" | "copy";
  // For scope repo: this repository's owner/name (from its git remote), or its folder name
  repo?: string;
  // repo: this repository's AGENTS.md, CLAUDE.md and .claude/skills; user: the user's home folder, for every project (snapshot only)
  scope?: "repo" | "user";
}): Promise<CallToolResult>; };
```

## agents\_unload

Stop working as an agent profile that was loaded with agents\_load. Give the same id or name. Returns what to do: drop that profile's instructions, skills and context sources and go back to normal. Nothing is stored server-side; for a completely clean slate the user can run /clear or start a new session.

```ts
declare const tools: { mcp__MassifyAI__agents_unload(args: {
  // The profile's id, when you have it
  id?: string;
  // Or its exact name, matched without regard to case
  name?: string;
  // The repository this session works in, as owner/repo or its URL, when you know it
  repo?: string;
}): Promise<CallToolResult>; };
```
