Skip to main content
Glama

chaingpt_invoke_chat

Chat with a Web3 AI assistant to get blockchain insights, analyze crypto markets, and answer crypto-related questions using trained blockchain data and real-time information.

Instructions

    Invoke a chat with ChainGPT AI and get a response based on the provided question.
    Web3-native AI assistant built specifically for the crypto world. 
    It has deep blockchain expertise, enabling seamless integration of crypto-aware AI into your applications. 
    The model is trained on blockchain data (smart contracts, DeFi protocols, NFTs, DAOs) and real-time market information, 
    making it ideal for use cases like customer support, on-chain analytics, trading assistance, and community engagement

    Capabilities:
        - Aggregate any amount of web3 market statistics
        - Interact with Blockchains 
        - Live information tracking of 5,000+ cryptos.
        - AI Generated News

    ⚠️ COST WARNING: This tool makes an API call to ChainGPT which may incur costs.

    This tool allows you to interact with ChainGPT's conversational AI capabilities.

    Args:
        question (str): The question or message to send to ChainGPT.
        chatHistory (str, optional): Whether to include chat history in the request.
            Defaults to "off" if not provided. Can be set to "on" to maintain conversation context.
        sdkUniqueId (str, optional): The unique identifier for the chat.
            Defaults to a random UUID if not provided
    Returns:
        The response from ChainGPT AI to the provided question or message.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYes
chatHistoryYes

Implementation Reference

  • The asynchronous handler function that executes the tool logic: calls ChainGPT's createChatBlob API with question and chatHistory, returns the bot response in MCP format, or an error message if failed.
    async (params) => {
      try {
        const response = await generalchat.createChatBlob({
          question: params.question,
          chatHistory: params.chatHistory,
        });
        return {
          content: [
            {
              type: "text",
              text: response.data.bot,
            },
          ],
        };
      } catch (error) {
        const errorMessage =
          error instanceof Error ? error.message : "invoke_chat_Unknown_Error";
        return {
          content: [
            {
              type: "text",
              text: errorMessage,
            },
          ],
          isError: true,
        };
      }
    }
  • Zod schema defining the input parameters for the chaingpt_invoke_chat tool: question (required string) and chatHistory (optional string).
    export const chatSchema = {
        question: z.string().min(1, 'Question is required'),
        chatHistory: z.string(),
    }
  • Registers the 'chaingpt_invoke_chat' tool on the MCP server, providing the tool name, detailed description, input schema, and handler function.
    server.tool(
      "chaingpt_invoke_chat",
      `
          Invoke a chat with ChainGPT AI and get a response based on the provided question.
          Web3-native AI assistant built specifically for the crypto world. 
          It has deep blockchain expertise, enabling seamless integration of crypto-aware AI into your applications. 
          The model is trained on blockchain data (smart contracts, DeFi protocols, NFTs, DAOs) and real-time market information, 
          making it ideal for use cases like customer support, on-chain analytics, trading assistance, and community engagement
    
          Capabilities:
              - Aggregate any amount of web3 market statistics
              - Interact with Blockchains 
              - Live information tracking of 5,000+ cryptos.
              - AI Generated News
    
          ⚠️ COST WARNING: This tool makes an API call to ChainGPT which may incur costs.
    
          This tool allows you to interact with ChainGPT's conversational AI capabilities.
    
          Args:
              question (str): The question or message to send to ChainGPT.
              chatHistory (str, optional): Whether to include chat history in the request.
                  Defaults to "off" if not provided. Can be set to "on" to maintain conversation context.
              sdkUniqueId (str, optional): The unique identifier for the chat.
                  Defaults to a random UUID if not provided
          Returns:
              The response from ChainGPT AI to the provided question or message.
          `,
      chatSchema,
      async (params) => {
        try {
          const response = await generalchat.createChatBlob({
            question: params.question,
            chatHistory: params.chatHistory,
          });
          return {
            content: [
              {
                type: "text",
                text: response.data.bot,
              },
            ],
          };
        } catch (error) {
          const errorMessage =
            error instanceof Error ? error.message : "invoke_chat_Unknown_Error";
          return {
            content: [
              {
                type: "text",
                text: errorMessage,
              },
            ],
            isError: true,
          };
        }
      }
    );
  • Initializes the GeneralChat SDK client instance used by the handler, configured with the ChainGPT API secret key from config.
    const generalchat = new GeneralChat({
      apiKey: config.chaingpt.secretKey,
    });
  • src/tools/index.ts:4-7 (registration)
    Top-level tool registration function that invokes registerChatTools(), which in turn registers the chaingpt_invoke_chat tool.
    export const registerTools = () => {
        registerChatTools();
        registerNewsTools();
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively adds valuable context: it warns about potential costs ('⚠️ COST WARNING: This tool makes an API call to ChainGPT which may incur costs'), describes the AI's training data and capabilities, and mentions that it can maintain conversation context. However, it doesn't cover rate limits, error handling, or authentication requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, but contains redundant sections (e.g., repeating 'This tool allows you to interact with ChainGPT's conversational AI capabilities' after already stating the purpose). The capabilities list and Web3 context are useful but could be more tightly integrated. Some sentences don't earn their place in terms of direct tool invocation guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and 2 parameters with 0% schema coverage, the description does a fair job. It covers purpose, some behavioral context (cost warning, capabilities), and parameter semantics. However, it lacks details on response format, error cases, and doesn't fully address the schema discrepancy with 'sdkUniqueId.' For a chat tool with cost implications, more completeness would be beneficial.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It provides clear semantics for both parameters: 'question' is described as 'The question or message to send to ChainGPT,' and 'chatHistory' is explained with its optional nature, default value ('off'), and purpose ('to maintain conversation context'). However, it mentions an 'sdkUniqueId' parameter in the Args section that isn't in the input schema, creating some confusion.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Invoke a chat with ChainGPT AI and get a response based on the provided question.' It specifies the verb ('invoke a chat') and resource ('ChainGPT AI'), but doesn't explicitly differentiate from sibling tools like 'chaingpt_get_chat_history' beyond mentioning 'conversational AI capabilities.'

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage context by stating it's 'ideal for use cases like customer support, on-chain analytics, trading assistance, and community engagement' and mentioning its 'Web3-native' focus. However, it doesn't explicitly state when to use this tool versus alternatives like 'chaingpt_get_ai_crypto_news' or 'chaingpt_get_chat_history,' nor does it provide clear exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/mikeysrecipes/chaingpt-mcp'

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