• IDD
  • IDD
  • Job Scheduler Services Creation
  • Skybuffer AI
    • Skybuffer AI Installation and Initial Setup
      • On Business Technology Platform (BTP)
        • Skybuffer AI Installation Guide on BTP
      • On Premise: XSA Runtime and SAP HANA EE
        • Installing SAP HANA Including XS Runtime
        • XS Deployment Process
      • Post Installation User Guide
    • AI Agent
      • AI Agent Configurator
        • Register New AI Agent
        • Intents and Entities Creation
        • Tool Creation and Management
        • Actions
          • Message and Content Actions
            • Structured Messages
            • Adaptive Card
            • Sending Notifications
          • Destination Calls Actions
          • Conversation Flow and Memory Actions
          • Process Data Actions
            • Email Processing Action
            • Email Post-Processing Action
            • File Parsing Action
            • Upload File to Document Grounding
          • AI Actions
            • Generative AI Action
            • Document Grounding Action
            • Log Insight Action
            • Tools Orchestration Action
        • Translation
        • Scheduling
        • Communication Channels
          • Tools Activation
          • Destination Assignment
          • Copy the Existing Channel
          • Webchat Communication Channel Setup
          • Facebook Messenger Communication Channel Setup
          • Zoom Communication Channel Setup
          • Slack Communication Channel Setup
          • MS Teams Communication Channel Setup
          • Telegram Communication Channel Setup
          • Viber Communication Channel Setup
          • WhatsApp Communication Channel Setup
          • FLP Chat Communication Channel Setup
          • Background Execution Communication Channel Setup
          • OpenAiCompatible Channel Setup
          • MCP Channel
        • Monitor Section
      • Data Source Scenarios Management
      • Business AI Scenarios
      • Document Grounding Hub
      • Destination Management
      • Emails AI Processing Monitor
      • Models Hub
      • Identity Providers
      • Survey Craft
      • Predefined Response Translator
    • AI Connector
      • AI Connector Configurator
      • AI Connector Logs
      • AWS Integration
      • Twilio Integration
    • SAP Backend for Business AI
      • Business AI Scenarios Package Administration
        • Installation Guide
        • Uninstallation Guide
      • Business AI Scenarios Package Maintenance Guide
        • Product License
        • Configuration of Email Sending Mechanism
          • Configuration Settings
          • Setup of Specific Email Sending Control
        • Technical User Setup
          • Central oData Service Authorization Role Maintenance
          • Technical User ID Creation
        • Assigning Business AI Scenarios to ABAP RIK Classes
        • Simplified User Creation Scenario Setup (Without Approval Workflow)
          • Maintain and Assign Reference Users for User Creation Scenario
          • Activate Notification for New User Creation (Optional)
        • User Creation Scenario Setup with Approval Workflow
          • Configure Approval Workflow for User Creation Scenario
          • Set Up Approval Steps for Different User Types Creation
      • MCP Server
        • MCP Server Configuration in ABAP System
        • MCP Tools Creation
    • Hybrid Chats
      • Hybrid Chats Maintenance Guide
        • Business and Technical Users Setup
          • Create Business and Technical Users
          • Create Business Partners
        • Tenant Configuration
        • Live Pool Management and Configuration
          • Start Live Pool
          • Manage Live Pool
        • System Configuration
          • Configure Status Profile
          • Set Up Technical Messages for Hybrid Chats
        • Hybrid Chats Configuration
        • Hybrid Chats Categorization
          • Categorization Management
          • Categorization Mapping
          • Translate Categories
      • Hybrid Chats User Manual
        • Hybrid Chats
          • HC Archive Mode
          • HC Active Mode
        • HC My Data
          • Edit Personal Data and Profile Picture
          • Default Settings Management
          • Notification and Dialogue Manual Mode Management
          • Quick Replies Management
            • Standard User Mode - Quick Replies
            • Administrator User Mode - Quick Replies
        • HC Analytics
          • HC Analytics
          • Operator Activity Analytics
          • Exit Survey Analytics
        • HC Teams
          • Access HC Teams Application
          • Create New Team
          • Create New Team Member
          • Edit Agent
          • Edit Team Name
    • HOW-TO Guides
      • MS Teams Integration. Single Sign-On
        • Create Azure Bot Service
        • Configure Azure Bot Service and Connect to the AI Agent MS Teams Channel
        • Create Middleware SSO Application
        • Configure Bot Service Application SSO
        • Create Azure AD Enterprise Application for SAP Backend
        • Configure oAuth2 in SAP System
        • Assign Identity Provider in AI Agent Channel Configuration
        • Deploy Your App into Microsoft Teams
        • Managing Application Keys
      • Office 365 Shared Mailboxes (IMAP) Integration
      • SAP AI Core Integration. Ollama Server Setup
      • DGX Spark Server Configuration
      • Skybuffer AI PoC Setup
        • SAP BTP
      • MS SharePoint Integration. Add-in Registration
    • Troubleshooting
      • Edge Browser Access Issue

MCP Tools Creation

6 views 0

Guidelines for Complex MCP Tools Creation (Create / Update / Delete)

This guide outlines the standard procedure for creating a custom ABAP class and exposing it as a complex Model Context Protocol (MCP) Tool.

Step 1: Create the ABAP Class

Create a new ABAP class in the SAP backend. To function as an MCP Tool, this class must implement the following standard interfaces:

  • /SKYBFR/IF_YAI_AUTHORIZATION (Optional): Provides the ability to implement custom authorization logic via the CHECK_AUTHORIZATION_INT method. Note: Standard SAP authorization checks are never skipped; this is for additional, tool-specific checks.
  • /SKYBFR/IF_YAI_OPERATION (Mandatory): Provides the main method for executing your custom business logic via RUN_OPERATION_INT.
  • /SKYBFR/IF_YAI_SCHEMA (Mandatory): Provides the method to define the tool’s input and output metadata via /SKYBFR/IF_YAI_SCHEMA~GET_SCHEMA.

Step 2: Define MCP Tool Metadata

You must define the parameters your tool accepts and returns.

1. Implement the Schema Method: Implement the /SKYBFR/IF_YAI_SCHEMA~GET_SCHEMA method to map your input (et_input) and output (et_output) variables. Ensure you provide clear descriptions, as the LLM relies on these to understand how to use the tool.

ABAP:

METHOD /skybfr/if_yai_schema~get_schema.
et_input = VALUE #(
( name = ‘your_input_parameter’
type = ‘string’
description = ‘Description of what this input does and how it should be formatted.’ )
).

et_output = VALUE #(
( name = ‘your_output_parameter’
type = ‘string’
description = ‘Description of the result or value returned by this tool.’ )
).
ENDMETHOD.

2. Define the Corresponding Type: In the PROTECTED SECTION of your class, create a data structure that exactly matches the schema defined above. This structure will be used to hold the values during execution.

ABAP:

PROTECTED SECTION.
TYPES:
BEGIN OF gty_s_result,
“Input
your_input_parameter TYPE string,
“Output
your_output_parameter TYPE string,
END OF gty_s_result.

Step 3: Implement the Tool’s Logic

Implement your custom business logic inside the RUN_OPERATION_INT method. You must include the standard macro structure to seamlessly handle data mapping between SAP and the MCP Server.

1. Include Macros: At the top of your method implementation, include the following:

ABAP:

INCLUDE /skybfr/yai_skill_macros.

2. Handle Data Operations:

  • Reading Input: To retrieve the input data passed by the MCP Tool call, use the macro: get_memory
  • Returning Output: To pass your processed results back to the MCP Server, use the macro: set_memory

Step 4: Register your ABAP-based MCP Tool

Once the class is active, it must be registered in the system so the MCP server can discover it.

  1. Execute transaction SM30.
  2. Maintain the table/view: /SKYBFR/YAICMCPN
  3. Add a new entry with the following details:
    • Tool Name: your_tool_name_in_snake_case (This is the name the LLM will see and call)
    • ABAP Class: ZCL_YOUR_CUSTOM_CLASS (The class created in Step 1)
    • Tool Description: A clear, concise description of what the tool accomplishes in the SAP system.

Step 5: Verify the Tool via API

Once registered, verify that your newly added tool is properly exposed by fetching it from the MCP Server. You can do this by executing the tools/list method via a cURL command:

Bash:

curl -X POST http://[YOUR_SERVER_PATH]/mcp \
-H “Content-Type: application/json” \
-H “Accept: application/json, text/event-stream” \
-H “Mcp-Session-Id: [YOUR_SESSION_ID]” \
-d ‘{
“jsonrpc”: “2.0”,
“id”: 2,
“method”: “tools/list”
}’

NOTE: Verify that your new tool name and schema appear in the JSON response.

Was this helpful?

Yes  No
Related Articles
  • MCP Server Configuration in ABAP System
  • Upload File to Document Grounding
  • Job Scheduler Services Creation
  • MCP Server
  • Data Source Scenarios Management
  • Sending Notifications
Copyright 2022 Skybuffer.com. All Rights Reserved.