Skip to main content
Glama
BiteFoundry Teams MCP Server

BiteFoundry Teams MCP Server

edit_message

Idempotent

Edit a previously sent Teams message by replacing its body, swapping one exact phrase, or renaming a channel root post title.

Instructions

Edit a message previously sent by the signed-in user. Choose exactly one mode: markdown (replace full body), find + replace (replace one unique literal phrase while preserving HTML), or subject (rename a channel root post title). Requires Chat.ReadWrite (chats) or ChannelMessage.ReadWrite (channels) and Teams policy allowing edits. Returns { ok, conv_key, msg_id }.

Input Schema

NameRequiredDescriptionDefault
findNoExact phrase occurring once in a single editable text node (must be paired with replace).
msg_idYesID of the message sent by the current user to edit.
targetYesConversation conv_key (chat:... or chan:team:channel), "Team/Channel", or unique conversation title substring.
replaceNoLiteral replacement text for find; pass an empty string to remove the matched phrase.
subjectNoNew plain-text title for a channel root post you sent (mutually exclusive with body edits and thread_root_id).
markdownNoMarkdown to replace the entire message body (mutually exclusive with find/replace and subject).
thread_root_idNoOptional channel thread root post ID required when editing a reply inside a channel thread.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.1.1
    • changedInput schema / properties / find / description
      Previous value: -"Exact phrase occurring once in a single editable text node."New value: +"Exact phrase occurring once in a single editable text node (must be paired with replace)."
    • changedInput schema / properties / markdown / description
      Previous value: -"Markdown to replace the entire message body."New value: +"Markdown to replace the entire message body (mutually exclusive with find/replace and subject)."
    • addedInput schema / properties / msg_id / description
      Added value: +"ID of the message sent by the current user to edit."
    • changedInput schema / properties / replace / description
      Previous value: -"Literal replacement text. An empty string removes the phrase."New value: +"Literal replacement text for find; pass an empty string to remove the matched phrase."
    • changedInput schema / properties / subject / description
      Previous value: -"New plain-text title for a channel root post you sent."New value: +"New plain-text title for a channel root post you sent (mutually exclusive with body edits and thread_root_id)."
    • addedInput schema / properties / target / description
      Added value: +"Conversation conv_key (chat:... or chan:team:channel), \"Team/Channel\", or unique conversation title substring."
    • addedInput schema / properties / thread_root_id / description
      Added value: +"Optional channel thread root post ID required when editing a reply inside a channel thread."
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Adds substantial context beyond the annotations: required scopes per target type, an org policy gate, the constraint that find must match exactly once in a single text node, that find+replace preserves HTML while markdown replaces the whole body, and the exact return shape { ok, conv_key, msg_id }. Minor tension with idempotentHint=true since a repeated find+replace would fail once the phrase is gone, but this is an edge case rather than a contradiction.

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

Conciseness5/5

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

Front-loaded with the action and the sender restriction, then modes, then prerequisites, then return shape — a logical progression. Every sentence carries information the agent needs; no filler or restatement of the title.

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 7-parameter tool with a three-way oneOf and no output schema, the description covers scope, mode exclusivity, auth requirements, a literal-match constraint, and the response shape. An agent can invoke this correctly without opening the schema.

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 description coverage is already 100%, so the schema carries the per-parameter detail and baseline is 3. The description earns an extra point by naming the modes in agent-facing terms, which makes the schema's oneOf exclusivity readable at a glance, and by highlighting the HTML-preserving semantics of find+replace.

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?

States a specific verb and resource ("Edit a message") plus a scope restriction ("previously sent by the signed-in user"), which immediately separates it from send_message, reply_message, and delete_message. The three named edit modes further pin down what "edit" means operationally.

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 explicit mode-selection guidance ("Choose exactly one mode: markdown... find + replace... subject...") with the condition each mode fits, and states the prerequisite permissions and Teams policy gate. It stops short of routing the agent to alternatives (e.g., delete-and-resend, or reply_message) when editing is unavailable.

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