Skip to content

feat: expose avatar parameter in send_message tool - #1

Open
Zernio-Elean wants to merge 1 commit into
mainfrom
feature/send-message-avatar-support
Open

feat: expose avatar parameter in send_message tool#1
Zernio-Elean wants to merge 1 commit into
mainfrom
feature/send-message-avatar-support

Conversation

@Zernio-Elean

Copy link
Copy Markdown

Summary

Expose avatar as an optional parameter in the send_message MCP tool so messages can be sent with the operator's real profile photo.

The Crisp REST API and the internal crisp-client.ts already support user.avatar in SendMessageOptions, but the tool schema didn't expose it. This wires it up.

Changes

src/index.ts (+9, -1):

  1. Tool schema: Added avatar as optional string property in send_message inputSchema
  2. Tool handler: Reads avatar from args and passes it in the user object to crispClient.sendMessage()

No changes needed in crisp-client.ts since SendMessageOptions already supports user.avatar.

Usage

// 1. Get operator avatar URL
get_operators() // returns list with avatar URLs per operator

// 2. Send message with operator identity
send_message({
  session_id: "...",
  content: "Hello!",
  nickname: "Elean",
  avatar: "https://storage.crisp.chat/users/avatar/operator/.../photo.png"
})

Test plan

  • Tested locally with a real Crisp conversation
  • Message displays with correct operator photo and name in Crisp UI
  • Build passes (npm run build)

The Crisp REST API and the internal crisp-client already support
sending messages with a custom avatar URL via user.avatar, but
the send_message MCP tool did not expose this field.

This adds avatar as an optional parameter so operators can send
messages that display their real profile photo in Crisp. Combined
with get_operators (which returns avatar URLs), messages sent via
the MCP server now appear with the operator's actual identity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant