@sumup/agent-toolkit
    Preparing search index...

    Class SumUpAgentToolkit

    Hierarchy

    • McpServer
      • SumUpAgentToolkit
    Index

    Constructors

    • Parameters

      • __namedParameters: {
            apiKey: string;
            configuration: ServerOptions;
            host?: string;
            resource?: string;
        }

      Returns SumUpAgentToolkit

    Properties

    server: Server

    The underlying Server instance, useful for advanced operations like sending notifications.

    Methods

    • Closes the connection.

      Returns Promise<void>

    • Attaches to the given transport, starts it, and starts listening for messages.

      The server object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.

      Parameters

      • transport: Transport

      Returns Promise<void>

    • Checks if the server is connected to a transport.

      Returns boolean

      True if the server is connected

    • Registers a zero-argument prompt name, which will run the given function when the client calls it.

      Parameters

      • name: string
      • cb: (
            extra: RequestHandlerExtra<ServerRequest, ServerNotification>,
        ) =>
            | {
                _meta?: { [key: string]: unknown };
                description?: string;
                messages: {
                    content:
                        | { _meta?: { [key: string]: unknown }; text: string; type: "text" }
                        | {
                            _meta?: { [key: string]: unknown };
                            data: string;
                            mimeType: string;
                            type: "image";
                        }
                        | {
                            _meta?: { [key: string]: unknown };
                            data: string;
                            mimeType: string;
                            type: "audio";
                        }
                        | {
                            _meta?: { [key: string]: unknown };
                            description?: string;
                            icons?: {
                                mimeType?: (...) | (...);
                                sizes?: (...) | (...);
                                src: string;
                            }[];
                            mimeType?: string;
                            name: string;
                            title?: string;
                            type: "resource_link";
                            uri: string;
                        }
                        | {
                            _meta?: { [key: string]: unknown };
                            resource:
                                | {
                                    _meta?: { [key: ...]: ... };
                                    mimeType?: string;
                                    text: string;
                                    uri: string;
                                }
                                | {
                                    _meta?: { [key: ...]: ... };
                                    blob: string;
                                    mimeType?: string;
                                    uri: string;
                                };
                            type: "resource";
                        };
                    role: "user"
                    | "assistant";
                }[];
                [key: string]: unknown;
            }
            | Promise<
                {
                    _meta?: { [key: string]: unknown };
                    description?: string;
                    messages: {
                        content:
                            | { _meta?: { [key: string]: unknown }; text: string; type: "text" }
                            | {
                                _meta?: { [key: string]: unknown };
                                data: string;
                                mimeType: string;
                                type: "image";
                            }
                            | {
                                _meta?: { [key: string]: unknown };
                                data: string;
                                mimeType: string;
                                type: "audio";
                            }
                            | {
                                _meta?: { [key: string]: unknown };
                                description?: string;
                                icons?: { mimeType?: ...; sizes?: ...; src: ... }[];
                                mimeType?: string;
                                name: string;
                                title?: string;
                                type: "resource_link";
                                uri: string;
                            }
                            | {
                                _meta?: { [key: string]: unknown };
                                resource:
                                    | {
                                        _meta?: (...)
                                        | (...);
                                        mimeType?: (...) | (...);
                                        text: string;
                                        uri: string;
                                    }
                                    | {
                                        _meta?: (...)
                                        | (...);
                                        blob: string;
                                        mimeType?: (...) | (...);
                                        uri: string;
                                    };
                                type: "resource";
                            };
                        role: "user"
                        | "assistant";
                    }[];
                    [key: string]: unknown;
                },
            >

      Returns RegisteredPrompt

      Use registerPrompt instead.

    • Registers a zero-argument prompt name (with a description) which will run the given function when the client calls it.

      Parameters

      • name: string
      • description: string
      • cb: (
            extra: RequestHandlerExtra<ServerRequest, ServerNotification>,
        ) =>
            | {
                _meta?: { [key: string]: unknown };
                description?: string;
                messages: {
                    content:
                        | { _meta?: { [key: string]: unknown }; text: string; type: "text" }
                        | {
                            _meta?: { [key: string]: unknown };
                            data: string;
                            mimeType: string;
                            type: "image";
                        }
                        | {
                            _meta?: { [key: string]: unknown };
                            data: string;
                            mimeType: string;
                            type: "audio";
                        }
                        | {
                            _meta?: { [key: string]: unknown };
                            description?: string;
                            icons?: {
                                mimeType?: (...) | (...);
                                sizes?: (...) | (...);
                                src: string;
                            }[];
                            mimeType?: string;
                            name: string;
                            title?: string;
                            type: "resource_link";
                            uri: string;
                        }
                        | {
                            _meta?: { [key: string]: unknown };
                            resource:
                                | {
                                    _meta?: { [key: ...]: ... };
                                    mimeType?: string;
                                    text: string;
                                    uri: string;
                                }
                                | {
                                    _meta?: { [key: ...]: ... };
                                    blob: string;
                                    mimeType?: string;
                                    uri: string;
                                };
                            type: "resource";
                        };
                    role: "user"
                    | "assistant";
                }[];
                [key: string]: unknown;
            }
            | Promise<
                {
                    _meta?: { [key: string]: unknown };
                    description?: string;
                    messages: {
                        content:
                            | { _meta?: { [key: string]: unknown }; text: string; type: "text" }
                            | {
                                _meta?: { [key: string]: unknown };
                                data: string;
                                mimeType: string;
                                type: "image";
                            }
                            | {
                                _meta?: { [key: string]: unknown };
                                data: string;
                                mimeType: string;
                                type: "audio";
                            }
                            | {
                                _meta?: { [key: string]: unknown };
                                description?: string;
                                icons?: { mimeType?: ...; sizes?: ...; src: ... }[];
                                mimeType?: string;
                                name: string;
                                title?: string;
                                type: "resource_link";
                                uri: string;
                            }
                            | {
                                _meta?: { [key: string]: unknown };
                                resource:
                                    | {
                                        _meta?: (...)
                                        | (...);
                                        mimeType?: (...) | (...);
                                        text: string;
                                        uri: string;
                                    }
                                    | {
                                        _meta?: (...)
                                        | (...);
                                        blob: string;
                                        mimeType?: (...) | (...);
                                        uri: string;
                                    };
                                type: "resource";
                            };
                        role: "user"
                        | "assistant";
                    }[];
                    [key: string]: unknown;
                },
            >

      Returns RegisteredPrompt

      Use registerPrompt instead.

    • Registers a prompt name accepting the given arguments, which must be an object containing named properties associated with Zod schemas. When the client calls it, the function will be run with the parsed and validated arguments.

      Type Parameters

      • Args extends ZodRawShapeCompat

      Parameters

      • name: string
      • argsSchema: Args
      • cb: PromptCallback<Args>

      Returns RegisteredPrompt

      Use registerPrompt instead.

    • Registers a prompt name (with a description) accepting the given arguments, which must be an object containing named properties associated with Zod schemas. When the client calls it, the function will be run with the parsed and validated arguments.

      Type Parameters

      • Args extends ZodRawShapeCompat

      Parameters

      • name: string
      • description: string
      • argsSchema: Args
      • cb: PromptCallback<Args>

      Returns RegisteredPrompt

      Use registerPrompt instead.

    • Registers a prompt with a config object and callback.

      Type Parameters

      • Args extends ZodRawShapeCompat

      Parameters

      • name: string
      • config: { argsSchema?: Args; description?: string; title?: string }
      • cb: PromptCallback<Args>

      Returns RegisteredPrompt

    • Registers a resource with a config object and callback. For static resources, use a URI string. For dynamic resources, use a ResourceTemplate.

      Parameters

      • name: string
      • uriOrTemplate: string
      • config: ResourceMetadata
      • readCallback: ReadResourceCallback

      Returns RegisteredResource

    • Registers a resource with a config object and callback. For static resources, use a URI string. For dynamic resources, use a ResourceTemplate.

      Parameters

      • name: string
      • uriOrTemplate: ResourceTemplate
      • config: ResourceMetadata
      • readCallback: ReadResourceTemplateCallback

      Returns RegisteredResourceTemplate

    • Registers a tool with a config object and callback.

      Type Parameters

      • InputArgs extends AnySchema | ZodRawShapeCompat
      • OutputArgs extends AnySchema | ZodRawShapeCompat

      Parameters

      • name: string
      • config: {
            _meta?: Record<string, unknown>;
            annotations?: {
                destructiveHint?: boolean;
                idempotentHint?: boolean;
                openWorldHint?: boolean;
                readOnlyHint?: boolean;
                title?: string;
            };
            description?: string;
            inputSchema?: InputArgs;
            outputSchema?: OutputArgs;
            title?: string;
        }
      • cb: ToolCallback<InputArgs>

      Returns RegisteredTool

    • Registers a resource name at a fixed URI, which will use the given callback to respond to read requests.

      Parameters

      • name: string
      • uri: string
      • readCallback: ReadResourceCallback

      Returns RegisteredResource

      Use registerResource instead.

    • Registers a resource name at a fixed URI with metadata, which will use the given callback to respond to read requests.

      Parameters

      • name: string
      • uri: string
      • metadata: ResourceMetadata
      • readCallback: ReadResourceCallback

      Returns RegisteredResource

      Use registerResource instead.

    • Registers a resource name with a template pattern, which will use the given callback to respond to read requests.

      Parameters

      • name: string
      • template: ResourceTemplate
      • readCallback: ReadResourceTemplateCallback

      Returns RegisteredResourceTemplate

      Use registerResource instead.

    • Registers a resource name with a template pattern and metadata, which will use the given callback to respond to read requests.

      Parameters

      • name: string
      • template: ResourceTemplate
      • metadata: ResourceMetadata
      • readCallback: ReadResourceTemplateCallback

      Returns RegisteredResourceTemplate

      Use registerResource instead.

    • Sends a logging message to the client, if connected. Note: You only need to send the parameters object, not the entire JSON RPC message

      Parameters

      • params: {
            _meta?: { [key: string]: unknown };
            data: unknown;
            level:
                | "error"
                | "debug"
                | "info"
                | "notice"
                | "warning"
                | "critical"
                | "alert"
                | "emergency";
            logger?: string;
            [key: string]: unknown;
        }
      • OptionalsessionId: string

        optional for stateless and backward compatibility

      Returns Promise<void>

      LoggingMessageNotification

    • Sends a prompt list changed event to the client, if connected.

      Returns void

    • Sends a resource list changed event to the client, if connected.

      Returns void

    • Sends a tool list changed event to the client, if connected.

      Returns void

    • Registers a zero-argument tool name, which will run the given function when the client calls it.

      Parameters

      • name: string
      • cb: (
            extra: RequestHandlerExtra<ServerRequest, ServerNotification>,
        ) =>
            | {
                _meta?: { [key: string]: unknown };
                content: (
                    | { _meta?: { [key: string]: unknown }; text: string; type: "text" }
                    | {
                        _meta?: { [key: string]: unknown };
                        data: string;
                        mimeType: string;
                        type: "image";
                    }
                    | {
                        _meta?: { [key: string]: unknown };
                        data: string;
                        mimeType: string;
                        type: "audio";
                    }
                    | {
                        _meta?: { [key: string]: unknown };
                        description?: string;
                        icons?: { mimeType?: string; sizes?: (...)[]; src: string }[];
                        mimeType?: string;
                        name: string;
                        title?: string;
                        type: "resource_link";
                        uri: string;
                    }
                    | {
                        _meta?: { [key: string]: unknown };
                        resource:
                            | {
                                _meta?: { [key: string]: unknown };
                                mimeType?: string;
                                text: string;
                                uri: string;
                            }
                            | {
                                _meta?: { [key: string]: unknown };
                                blob: string;
                                mimeType?: string;
                                uri: string;
                            };
                        type: "resource";
                    }
                )[];
                isError?: boolean;
                structuredContent?: { [key: string]: unknown };
                [key: string]: unknown;
            }
            | Promise<
                {
                    _meta?: { [key: string]: unknown };
                    content: (
                        | { _meta?: { [key: string]: unknown }; text: string; type: "text" }
                        | {
                            _meta?: { [key: string]: unknown };
                            data: string;
                            mimeType: string;
                            type: "image";
                        }
                        | {
                            _meta?: { [key: string]: unknown };
                            data: string;
                            mimeType: string;
                            type: "audio";
                        }
                        | {
                            _meta?: { [key: string]: unknown };
                            description?: string;
                            icons?: {
                                mimeType?: (...) | (...);
                                sizes?: (...) | (...);
                                src: string;
                            }[];
                            mimeType?: string;
                            name: string;
                            title?: string;
                            type: "resource_link";
                            uri: string;
                        }
                        | {
                            _meta?: { [key: string]: unknown };
                            resource:
                                | {
                                    _meta?: { [key: ...]: ... };
                                    mimeType?: string;
                                    text: string;
                                    uri: string;
                                }
                                | {
                                    _meta?: { [key: ...]: ... };
                                    blob: string;
                                    mimeType?: string;
                                    uri: string;
                                };
                            type: "resource";
                        }
                    )[];
                    isError?: boolean;
                    structuredContent?: { [key: string]: unknown };
                    [key: string]: unknown;
                },
            >

      Returns RegisteredTool

      Use registerTool instead.

    • Registers a zero-argument tool name (with a description) which will run the given function when the client calls it.

      Parameters

      • name: string
      • description: string
      • cb: (
            extra: RequestHandlerExtra<ServerRequest, ServerNotification>,
        ) =>
            | {
                _meta?: { [key: string]: unknown };
                content: (
                    | { _meta?: { [key: string]: unknown }; text: string; type: "text" }
                    | {
                        _meta?: { [key: string]: unknown };
                        data: string;
                        mimeType: string;
                        type: "image";
                    }
                    | {
                        _meta?: { [key: string]: unknown };
                        data: string;
                        mimeType: string;
                        type: "audio";
                    }
                    | {
                        _meta?: { [key: string]: unknown };
                        description?: string;
                        icons?: { mimeType?: string; sizes?: (...)[]; src: string }[];
                        mimeType?: string;
                        name: string;
                        title?: string;
                        type: "resource_link";
                        uri: string;
                    }
                    | {
                        _meta?: { [key: string]: unknown };
                        resource:
                            | {
                                _meta?: { [key: string]: unknown };
                                mimeType?: string;
                                text: string;
                                uri: string;
                            }
                            | {
                                _meta?: { [key: string]: unknown };
                                blob: string;
                                mimeType?: string;
                                uri: string;
                            };
                        type: "resource";
                    }
                )[];
                isError?: boolean;
                structuredContent?: { [key: string]: unknown };
                [key: string]: unknown;
            }
            | Promise<
                {
                    _meta?: { [key: string]: unknown };
                    content: (
                        | { _meta?: { [key: string]: unknown }; text: string; type: "text" }
                        | {
                            _meta?: { [key: string]: unknown };
                            data: string;
                            mimeType: string;
                            type: "image";
                        }
                        | {
                            _meta?: { [key: string]: unknown };
                            data: string;
                            mimeType: string;
                            type: "audio";
                        }
                        | {
                            _meta?: { [key: string]: unknown };
                            description?: string;
                            icons?: {
                                mimeType?: (...) | (...);
                                sizes?: (...) | (...);
                                src: string;
                            }[];
                            mimeType?: string;
                            name: string;
                            title?: string;
                            type: "resource_link";
                            uri: string;
                        }
                        | {
                            _meta?: { [key: string]: unknown };
                            resource:
                                | {
                                    _meta?: { [key: ...]: ... };
                                    mimeType?: string;
                                    text: string;
                                    uri: string;
                                }
                                | {
                                    _meta?: { [key: ...]: ... };
                                    blob: string;
                                    mimeType?: string;
                                    uri: string;
                                };
                            type: "resource";
                        }
                    )[];
                    isError?: boolean;
                    structuredContent?: { [key: string]: unknown };
                    [key: string]: unknown;
                },
            >

      Returns RegisteredTool

      Use registerTool instead.

    • Registers a tool taking either a parameter schema for validation or annotations for additional metadata. This unified overload handles both tool(name, paramsSchema, cb) and tool(name, annotations, cb) cases.

      Note: We use a union type for the second parameter because TypeScript cannot reliably disambiguate between ToolAnnotations and ZodRawShape during overload resolution, as both are plain object types.

      Type Parameters

      • Args extends ZodRawShapeCompat

      Parameters

      • name: string
      • paramsSchemaOrAnnotations:
            | {
                destructiveHint?: boolean;
                idempotentHint?: boolean;
                openWorldHint?: boolean;
                readOnlyHint?: boolean;
                title?: string;
            }
            | Args
      • cb: ToolCallback<Args>

      Returns RegisteredTool

      Use registerTool instead.

    • Registers a tool name (with a description) taking either parameter schema or annotations. This unified overload handles both tool(name, description, paramsSchema, cb) and tool(name, description, annotations, cb) cases.

      Note: We use a union type for the third parameter because TypeScript cannot reliably disambiguate between ToolAnnotations and ZodRawShape during overload resolution, as both are plain object types.

      Type Parameters

      • Args extends ZodRawShapeCompat

      Parameters

      • name: string
      • description: string
      • paramsSchemaOrAnnotations:
            | {
                destructiveHint?: boolean;
                idempotentHint?: boolean;
                openWorldHint?: boolean;
                readOnlyHint?: boolean;
                title?: string;
            }
            | Args
      • cb: ToolCallback<Args>

      Returns RegisteredTool

      Use registerTool instead.

    • Registers a tool with both parameter schema and annotations.

      Type Parameters

      • Args extends ZodRawShapeCompat

      Parameters

      • name: string
      • paramsSchema: Args
      • annotations: {
            destructiveHint?: boolean;
            idempotentHint?: boolean;
            openWorldHint?: boolean;
            readOnlyHint?: boolean;
            title?: string;
        }
      • cb: ToolCallback<Args>

      Returns RegisteredTool

      Use registerTool instead.

    • Registers a tool with description, parameter schema, and annotations.

      Type Parameters

      • Args extends ZodRawShapeCompat

      Parameters

      • name: string
      • description: string
      • paramsSchema: Args
      • annotations: {
            destructiveHint?: boolean;
            idempotentHint?: boolean;
            openWorldHint?: boolean;
            readOnlyHint?: boolean;
            title?: string;
        }
      • cb: ToolCallback<Args>

      Returns RegisteredTool

      Use registerTool instead.