Skip to main content
Glama

mcp-google-sheets

ask-question.ts2.02 kB
import { httpClient, HttpMethod } from '@activepieces/pieces-common'; import { createAction, Property } from '@activepieces/pieces-framework'; import { wonderchatAuth } from '../..'; export const askQuestion = createAction({ name: 'askQuestion', displayName: 'Ask Question', description: 'Sends a question to a Wonderchat bot; returns the bot’s answer.', auth: wonderchatAuth, props: { chatbotId: Property.ShortText({ displayName: 'Chatbot Id', description: 'The ID of your chatbot (can be found in the URL when viewing your bot: /bot/YOUR_BOT_ID)', required: true, }), question: Property.LongText({ displayName: 'Question', description: 'The question you wish to ask your chatbot', required: true, }), chatlogId: Property.ShortText({ displayName: 'Chatlog Id', description: 'The ID of your chat session (can be found under Chatlog Details section, labeled as "ID")', required: false, }), context: Property.LongText({ displayName: 'Custom context', description: 'Additional custom context about the chat session (e.g., user information)', required: false, }), contextUrl: Property.LongText({ displayName: 'Context URL', description: 'URL of the page the user is on to provide additional context', required: false, }), }, async run({propsValue}) { const { chatbotId, question, chatlogId, context, contextUrl } = propsValue; const requestbody: any = { chatbotId, question, }; if (chatlogId) { requestbody.chatlogId = chatlogId; } if (context) { requestbody.context = context; } if (contextUrl) { requestbody.contextUrl = contextUrl; } const response = await httpClient.sendRequest({ method: HttpMethod.POST, url: 'https://app.wonderchat.io/api/v1/chat', headers: { 'Content-Type': 'application/json' }, body: requestbody, }); return response.body; }, });

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/activepieces/activepieces'

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