Skip to main content
Glama
abort-configuration-tool.ts1.32 kB
import { z } from "zod" import { V1Component } from "@pipedream/sdk" import { ToolConfigState } from "./types" import { wrapTool } from "./wrapper" import { ToolConfigStateMachine } from "./toolConfigStateMachine" export const ABORT_CONFIGURATION_TOOL_NAME = "ABORT_CONFIGURATION" type AbortConfigurationToolDef = { machine: ToolConfigStateMachine component: V1Component } export const abortConfigurationTool = ({ machine, component, }: AbortConfigurationToolDef) => { const toolName = `${ABORT_CONFIGURATION_TOOL_NAME}_${component.key.toUpperCase()}` return wrapTool( { name: toolName, description: "Abort the configuration process", inputSchema: z.object({}), isActive: (stage: ToolConfigState["stage"]) => stage === "CONFIGURING_TOOL", callback: async () => { const appHashid = await machine.getCurrentComponentAppHashid() machine.state = { stage: "APPS_SELECTED", availableApps: machine.state.availableApps ?? [], selectedApps: machine.state.selectedApps ?? [], } return { content: [ { type: "text", text: "Configuration process aborted.", hashid: appHashid, }, ], } }, }, machine ) }

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/rajnandan1/pd-mcp'

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