Skip to content

Teams Message Posting: "Missing body content" Error #129

@malikmalikayesha

Description

@malikmalikayesha

Description

Teams message posting consistently fails with 400 Bad Request - Missing body content error, even when body content is provided through the MCP server.

Expected Behavior

Teams messages should post successfully when using the send-channel-message tool with proper content and contentType.

Actual Behavior

API returns:

Microsoft Graph API error: 400 Bad Request - {"error":{"code":"BadRequest","message":"Missing body content"}}

Root Cause

Microsoft Graph API requires nested body structure, but the server passes parameters directly:

Current (fails):

{
  "content": "Test message",
  "contentType": "text"
}

Required by Microsoft Graph:

{
  "body": {
    "content": "Test message",
    "contentType": "text"
  }
}

Workaround

Manually nest the body structure:

{
  "body": {
    "body": {
      "content": "Test message",
      "contentType": "text"
    }
  }
}

Proposed Solution

Update src/graph-tools.ts to transform Teams message payloads to match Microsoft Graph API requirements.

Screenshots

Image Image Image Image Image

Post in Teams:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions