Skip to main content
Glama

execute_custom_workflow

Run custom workflows to automate LinkedIn tasks like lead searching, messaging, and profile analysis through AI assistants.

Instructions

Execute a custom workflow definition

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
definitionYes

Implementation Reference

  • The ExecuteCustomWorkflowTool class defines the tool handler, including name, operation name for LinkedAPI, Zod schema for validation, and the MCP tool definition via getTool().
    export class ExecuteCustomWorkflowTool extends OperationTool< TWorkflowDefinition, TWorkflowCompletion > { public override readonly name = 'execute_custom_workflow'; public override readonly operationName = OPERATION_NAME.customWorkflow; protected override readonly schema = z.object({ definition: z.any(), }); public override getTool(): Tool { return { name: this.name, description: 'Execute a custom workflow definition', inputSchema: { type: 'object', properties: { definition: { type: 'object' } }, required: ['definition'], }, }; } }
  • Zod schema for input validation: accepts any object under 'definition' key.
    protected override readonly schema = z.object({ definition: z.any(), });
  • The ExecuteCustomWorkflowTool is instantiated and registered in the LinkedApiTools class constructor, added to the array of available tools used by the MCP server.
    // Standard tools new SendMessageTool(progressCallback), new GetConversationTool(progressCallback), new CheckConnectionStatusTool(progressCallback), new RetrieveConnectionsTool(progressCallback), new SendConnectionRequestTool(progressCallback), new WithdrawConnectionRequestTool(progressCallback), new RetrievePendingRequestsTool(progressCallback), new RemoveConnectionTool(progressCallback), new SearchCompaniesTool(progressCallback), new SearchPeopleTool(progressCallback), new FetchCompanyTool(progressCallback), new FetchPersonTool(progressCallback), new FetchPostTool(progressCallback), new ReactToPostTool(progressCallback), new CommentOnPostTool(progressCallback), new CreatePostTool(progressCallback), new RetrieveSSITool(progressCallback), new RetrievePerformanceTool(progressCallback), // Sales Navigator tools new NvSendMessageTool(progressCallback), new NvGetConversationTool(progressCallback), new NvSearchCompaniesTool(progressCallback), new NvSearchPeopleTool(progressCallback), new NvFetchCompanyTool(progressCallback), new NvFetchPersonTool(progressCallback), // Other tools new ExecuteCustomWorkflowTool(progressCallback), new GetWorkflowResultTool(progressCallback), new GetApiUsageTool(progressCallback), ];
  • Base class OperationTool provides the core execute logic by mapping the tool's operationName to a LinkedAPI operation and executing it with progress handling.
    export abstract class OperationTool<TParams, TResult> extends LinkedApiTool<TParams, TResult> { public abstract readonly operationName: TOperationName; public override execute({ linkedapi, args, workflowTimeout, progressToken, }: { linkedapi: LinkedApi; args: TParams; workflowTimeout: number; progressToken?: string | number; }): Promise<TMappedResponse<TResult>> { const operation = linkedapi.operations.find( (operation) => operation.operationName === this.operationName, )! as Operation<TParams, TResult>; return executeWithProgress(this.progressCallback, operation, workflowTimeout, { params: args, progressToken, }); } }
  • The LinkedApiMCPServer exposes all registered tools (including execute_custom_workflow) via getTools(), which calls each tool's getTool() to provide MCP tool definitions.
    public getTools(): Tool[] { return this.tools.tools.map((tool) => tool.getTool()); }

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/Linked-API/linkedapi-mcp'

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