Skip to main content
Glama
sawa-zen

VRChat MCP Server

vrchat_get_invite_message

Retrieve specific invite messages from VRChat users, including normal invites, responses, requests, and request replies, using admin credentials to access other users' messages.

Instructions

Returns a specific invite message. Admin Credentials are required to view messages of other users!

Message type refers to a different collection of messages:
- message = Message during a normal invite
- response = Message when replying to a message
- request = Message when requesting an invite
- requestResponse = Message when replying to a request for invite

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesMust be a valid user ID.
messageTypeNoThe type of message to fetch. Must be a valid InviteMessageType.message
slotYesSlot number of the message to fetch.

Implementation Reference

  • Handler function that authenticates the VRChat client, calls inviteApi.getInviteMessage with userId, messageType, and slot, and returns the JSON response or an error message.
    async (params) => {
      try {
        await vrchatClient.auth()
        const response = await vrchatClient.inviteApi.getInviteMessage(
          params.userId,
          params.messageType,
          params.slot
        )
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(response.data, null, 2)
          }]
        }
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: 'Failed to retrieve invite message: ' + error
          }]
        }
      }
    }
  • Zod schema defining input parameters: userId (string), messageType (enum: 'message', 'response', 'request', 'requestResponse' with default 'message'), slot (number 0-11).
    {
      userId: z.string().min(1).describe(
        'Must be a valid user ID.'
      ),
      messageType: z.enum(['message', 'response', 'request', 'requestResponse']).default('message').describe(
        'The type of message to fetch. Must be a valid InviteMessageType.'
      ),
      slot: z.number().min(0).max(11).describe(
        'Slot number of the message to fetch.'
      ),
    },
  • Registers the vrchat_get_invite_message tool on the MCP server, specifying name, multi-line description, input schema, and handler function.
    server.tool(
      // Name
      'vrchat_get_invite_message',
      // Description
      `Returns a specific invite message. Admin Credentials are required to view messages of other users!
    
      Message type refers to a different collection of messages:
      - message = Message during a normal invite
      - response = Message when replying to a message
      - request = Message when requesting an invite
      - requestResponse = Message when replying to a request for invite
      `,
      {
        userId: z.string().min(1).describe(
          'Must be a valid user ID.'
        ),
        messageType: z.enum(['message', 'response', 'request', 'requestResponse']).default('message').describe(
          'The type of message to fetch. Must be a valid InviteMessageType.'
        ),
        slot: z.number().min(0).max(11).describe(
          'Slot number of the message to fetch.'
        ),
      },
      async (params) => {
        try {
          await vrchatClient.auth()
          const response = await vrchatClient.inviteApi.getInviteMessage(
            params.userId,
            params.messageType,
            params.slot
          )
          return {
            content: [{
              type: 'text',
              text: JSON.stringify(response.data, null, 2)
            }]
          }
        } catch (error) {
          return {
            content: [{
              type: 'text',
              text: 'Failed to retrieve invite message: ' + error
            }]
          }
        }
      }
    )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sawa-zen/vrchat-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server