Skip to main content
Glama
sawa-zen

VRChat MCP Server

vrchat_list_invite_messages

Retrieve invite messages for a specific VRChat user. Specify user ID and message type to view invitation history and responses.

Instructions

Returns a list of all the users Invite Messages. Admin Credentials are required to view messages of other users!

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesMust be a valid user ID
messageTypeYesThe type of message to fetch

Implementation Reference

  • The handler function for the 'vrchat_list_invite_messages' tool. It authenticates the VRChat client, fetches invite messages using the InviteApi.getInviteMessages method, and returns the JSON-stringified response or an error message.
    async (params) => {
      try {
        await vrchatClient.auth()
        const response = await vrchatClient.inviteApi.getInviteMessages(params.userId, params.messageType)
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(response.data, null, 2)
          }]
        }
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: 'Failed to get invite messages: ' + error
          }]
        }
      }
    }
  • Input schema defined using Zod, specifying 'userId' as a non-empty string and 'messageType' as an enum of invite message types.
    {
      userId: z.string().min(1).describe('Must be a valid user ID'),
      messageType: z.enum(['message', 'response', 'request', 'requestResponse']).describe('The type of message to fetch')
    },
  • Registers the 'vrchat_list_invite_messages' tool on the MCP server within the createInvitesTools function, including name, description, input schema, and inline handler.
    server.tool(
      // Name
      'vrchat_list_invite_messages',
      // Description
      'Returns a list of all the users Invite Messages. Admin Credentials are required to view messages of other users!',
      {
        userId: z.string().min(1).describe('Must be a valid user ID'),
        messageType: z.enum(['message', 'response', 'request', 'requestResponse']).describe('The type of message to fetch')
      },
      async (params) => {
        try {
          await vrchatClient.auth()
          const response = await vrchatClient.inviteApi.getInviteMessages(params.userId, params.messageType)
          return {
            content: [{
              type: 'text',
              text: JSON.stringify(response.data, null, 2)
            }]
          }
        } catch (error) {
          return {
            content: [{
              type: 'text',
              text: 'Failed to get invite messages: ' + error
            }]
          }
        }
      }
    )
  • src/main.ts:36-36 (registration)
    Calls createInvitesTools in the main server setup, which triggers the registration of the invites tools including 'vrchat_list_invite_messages'.
    createInvitesTools(server, vrchatClient)

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