Skip to main content
Glama
dappros

Ethora MCP Server

by dappros

ethora-app-create-chat

Enable users to create new chats within their applications, specifying app IDs, chat titles, and pin preferences for organized communication.

Instructions

Create a new chat for the logged-in user who has created the app.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdYesappId for app
pinnedYespinned for chat
titleYestitle for chat

Implementation Reference

  • src/tools.ts:234-260 (registration)
    Registration of the 'ethora-app-create-chat' tool including schema definition and handler function that invokes the API to create a chat.
    function craeteAppChatTool(server: McpServer) {
        server.registerTool(
            'ethora-app-create-chat',
            {
                description: 'Create a new chat for the logged-in user who has created the app.',
                inputSchema: {
                    appId: z.string().describe("appId for app"),
                    title: z.string().describe("title for chat"),
                    pinned: z.boolean().describe("pinned for chat"),
                }
            },
            async function ({ appId, title, pinned }) {
                try {
                    let result = await appCreateChat(appId, title, pinned)
                    let toolRes: CallToolResult = {
                        content: [{ type: "text", text: JSON.stringify(result.data) }]
                    }
                    return toolRes
                } catch (error) {
                    let toolRes: CallToolResult = {
                        content: [{ type: "text", text: "error: network error" }]
                    }
                    return toolRes
                }
            }
        )
    }
  • The core handler function for the ethora-app-create-chat tool, which calls appCreateChat and formats the response.
    async function ({ appId, title, pinned }) {
        try {
            let result = await appCreateChat(appId, title, pinned)
            let toolRes: CallToolResult = {
                content: [{ type: "text", text: JSON.stringify(result.data) }]
            }
            return toolRes
        } catch (error) {
            let toolRes: CallToolResult = {
                content: [{ type: "text", text: "error: network error" }]
            }
            return toolRes
        }
    }
  • Input schema and description for the ethora-app-create-chat tool using Zod.
    {
        description: 'Create a new chat for the logged-in user who has created the app.',
        inputSchema: {
            appId: z.string().describe("appId for app"),
            title: z.string().describe("title for chat"),
            pinned: z.boolean().describe("pinned for chat"),
        }
    },
  • Helper function appCreateChat that performs the HTTP POST request to create the chat via the API endpoint.
    export function appCreateChat(appId: string, title: string, pinned: boolean) {
      return httpClientDappros.post(
        `/apps/create-app-chat/${appId}`,
        {
          title,
          pinned
        }
      )
    }

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/dappros/ethora-mcp-server'

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