chat
Build and refine AI workflows through natural language conversation. Describe your workflow needs in plain English to get structured recommendations, integration guidance, and iterative design support without manual JSON construction.
Instructions
Send a message to the AgentLed AI agent and get a response. The agent can reason, plan, and build workflows through natural language conversation — no need to construct pipeline JSON manually.
Use this tool when you want to:
Build a workflow from a high-level description ("Create a lead enrichment workflow for SaaS companies")
Get recommendations on how to structure a workflow
Ask questions about available integrations or capabilities
Iterate on workflow design through conversation
The agent has access to the same planning tools, workflow builder, and workspace context as the in-app chat.
For multi-turn conversations, pass the session_id returned from the first message to maintain context across messages.
Example: chat("Build me a workflow that takes a LinkedIn company URL, enriches the data, and scores it by ICP fit")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | The message to send to the AI agent | |
| session_id | No | Session ID for multi-turn conversations. Use the session_id from a previous response to continue the same conversation. |
Implementation Reference
- src/tools/chat.ts:34-64 (handler)The async handler function for the 'chat' tool that calls the agent API.
async ({ message, session_id }, extra) => { const client = clientFactory(extra); try { const result = await client.chat(message, session_id); if (result.error) { return { content: [{ type: 'text' as const, text: `Chat error: ${result.error}`, }], isError: true, }; } return { content: [{ type: 'text' as const, text: result.response || JSON.stringify(result, null, 2), }], }; } catch (error: any) { return { content: [{ type: 'text' as const, text: `Chat request failed: ${error?.message || 'Unknown error'}`, }], isError: true, }; } } - src/tools/chat.ts:13-66 (registration)Registration function for the 'chat' tool using server.tool.
export function registerChatTools(server: McpServer, clientFactory: ClientFactory) { server.tool( 'chat', `Send a message to the AgentLed AI agent and get a response. The agent can reason, plan, and build workflows through natural language conversation — no need to construct pipeline JSON manually. Use this tool when you want to: - Build a workflow from a high-level description ("Create a lead enrichment workflow for SaaS companies") - Get recommendations on how to structure a workflow - Ask questions about available integrations or capabilities - Iterate on workflow design through conversation The agent has access to the same planning tools, workflow builder, and workspace context as the in-app chat. For multi-turn conversations, pass the session_id returned from the first message to maintain context across messages. Example: chat("Build me a workflow that takes a LinkedIn company URL, enriches the data, and scores it by ICP fit")`, { message: z.string().describe('The message to send to the AI agent'), session_id: z.string().optional().describe('Session ID for multi-turn conversations. Use the session_id from a previous response to continue the same conversation.'), }, async ({ message, session_id }, extra) => { const client = clientFactory(extra); try { const result = await client.chat(message, session_id); if (result.error) { return { content: [{ type: 'text' as const, text: `Chat error: ${result.error}`, }], isError: true, }; } return { content: [{ type: 'text' as const, text: result.response || JSON.stringify(result, null, 2), }], }; } catch (error: any) { return { content: [{ type: 'text' as const, text: `Chat request failed: ${error?.message || 'Unknown error'}`, }], isError: true, }; } } ); } - src/tools/chat.ts:30-33 (schema)Input validation schema for the 'chat' tool using Zod.
{ message: z.string().describe('The message to send to the AI agent'), session_id: z.string().optional().describe('Session ID for multi-turn conversations. Use the session_id from a previous response to continue the same conversation.'), },