Skip to main content
Glama

Set chat agent

set_chat_agent
Destructive

Put a company's agent into a group or a project's chat, or take it out, as the chat's settings do (PM-1247) — a group's administrators and, in a project's chat, whoever configures the project. Put in, it answers when it is mentioned ([~agent:product]) or its message is replied to, as the person who called it, and reads the chat only as far back as 'reads' says: 'after' (the default) — only what is written from now on — or 'last' with 'last' messages before each call, 1–30. Already in, nothing about it changes: take it out and put it in again to change what it reads. Taken out, it reads nothing more: a call still waiting is refused. Refused where the company's owner does not let that agent into chats (get_chat_agent_policy). Each put-in, take-out and call is a line in the company's journal, without the words.

Input Schema

NameRequiredDescriptionDefault
lastNoWith reads='last': how many earlier messages, 1–30.
agentYesThe agent, by key or handle — product, agent:analyst.
readsNo'after' (default) or 'last'.
chatIdYesThe chat's id.
removeNoTrue takes it out.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior5/5

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

Goes well beyond the annotations: states the agent answers only when mentioned ([~agent:product]) or replied to, acts as the caller, that removal makes pending calls be refused, that the owner's policy can block the operation, and that each put-in/take-out/call is journaled without message words. This is exactly the extra context destructiveHint=true cannot convey.

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

Conciseness3/5

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

The core action is front-loaded, but the body is one dense run-on packed with em-dashes and parentheticals ('as the chat's settings do (PM-1247)', '([~agent:product])', '1–30'), which hurts scannability. Nearly every clause carries real information, but the packaging makes it harder to parse than it needs to be.

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

Completeness5/5

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

For a 5-parameter mutation tool with no output schema, it covers permissions (group admins, project configurers), read-backfill semantics, idempotency/change caveat, refusal conditions, policy gate, and audit side effects. An agent has what it needs to decide and invoke correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description earns above that by explaining that 'reads' defaults to 'after' (only new messages) versus 'last' with 1–30 earlier messages per call, and by clarifying that changing the read scope requires a remove/re-add cycle rather than a direct update.

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

Purpose4/5

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

Specific verb+resource: puts a company's agent into a group/project chat or takes it out, with the scope of the target chat named. It is distinguishable from set_chat_agent_policy (referenced as the gatekeeper) and set_chat_members by focusing on agents rather than people, though that contrast is never stated explicitly. The PM-1247 ticket reference adds noise rather than clarity.

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?

Gives actionable conditions: 'remove' takes it out, 'reads' controls backfill, and crucially 'Already in, nothing about it changes: take it out and put it in again to change what it reads' — a genuinely useful workflow constraint. It also flags the refusal case and points at get_chat_agent_policy to check beforehand. It never explicitly routes to sibling tools like set_chat_members or set_chat_keeping.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources