' MCP protocol constants for JSON-RPC based local AI tool servers.
#IF NOT %DEF(PBX_MCP_PROTOCOL_PBI)
#DEFINE PBX_MCP_PROTOCOL_PBI
#include once "json_rpc2.inc"

CONST MCP_PROTOCOL_VERSION_2024_11_05 = "2024-11-05"
CONST MCP_PROTOCOL_VERSION_2025_03_26 = "2025-03-26"
CONST MCP_PROTOCOL_VERSION_2025_06_18 = "2025-06-18"
CONST MCP_FIELD_PROTOCOL_VERSION = "protocolVersion"
CONST MCP_FIELD_CAPABILITIES = "capabilities"
CONST MCP_FIELD_CLIENT_INFO = "clientInfo"
CONST MCP_FIELD_SERVER_INFO = "serverInfo"
CONST MCP_FIELD_NAME = "name"
CONST MCP_FIELD_VERSION = "version"
CONST MCP_FIELD_TOOLS = "tools"
CONST MCP_FIELD_RESOURCES = "resources"
CONST MCP_FIELD_PROMPTS = "prompts"
CONST MCP_FIELD_CONTENT = "content"
CONST MCP_FIELD_INPUT_SCHEMA = "inputSchema"
CONST MCP_FIELD_OUTPUT_SCHEMA = "outputSchema"
CONST MCP_FIELD_ARGUMENTS = "arguments"
CONST MCP_FIELD_TEXT = "text"
CONST MCP_FIELD_URI = "uri"
CONST MCP_FIELD_MIME_TYPE = "mimeType"
CONST MCP_FIELD_IS_ERROR = "isError"

CONST MCP_METHOD_INITIALIZE = "initialize"
CONST MCP_METHOD_INITIALIZED = "notifications/initialized"
CONST MCP_METHOD_PING = "ping"
CONST MCP_METHOD_TOOLS_LIST = "tools/list"
CONST MCP_METHOD_TOOLS_CALL = "tools/call"
CONST MCP_METHOD_RESOURCES_LIST = "resources/list"
CONST MCP_METHOD_RESOURCES_READ = "resources/read"
CONST MCP_METHOD_RESOURCES_SUBSCRIBE = "resources/subscribe"
CONST MCP_METHOD_RESOURCES_UNSUBSCRIBE = "resources/unsubscribe"
CONST MCP_METHOD_PROMPTS_LIST = "prompts/list"
CONST MCP_METHOD_PROMPTS_GET = "prompts/get"
CONST MCP_METHOD_LOGGING_SET_LEVEL = "logging/setLevel"
CONST MCP_METHOD_COMPLETION_COMPLETE = "completion/complete"
CONST MCP_METHOD_ROOTS_LIST = "roots/list"
CONST MCP_NOTIFY_CANCELLED = "notifications/cancelled"
CONST MCP_NOTIFY_PROGRESS = "notifications/progress"
CONST MCP_NOTIFY_MESSAGE = "notifications/message"
CONST MCP_NOTIFY_RESOURCE_UPDATED = "notifications/resources/updated"
CONST MCP_NOTIFY_TOOL_LIST_CHANGED = "notifications/tools/list_changed"
CONST MCP_NOTIFY_RESOURCE_LIST_CHANGED = "notifications/resources/list_changed"
CONST MCP_NOTIFY_PROMPT_LIST_CHANGED = "notifications/prompts/list_changed"

CONST MCP_ROLE_USER = "user"
CONST MCP_ROLE_ASSISTANT = "assistant"
CONST MCP_CONTENT_TEXT = "text"
CONST MCP_CONTENT_IMAGE = "image"
CONST MCP_CONTENT_AUDIO = "audio"
CONST MCP_CONTENT_RESOURCE = "resource"

CONST MCP_ERR_TOOL_NOT_FOUND = -32001
CONST MCP_ERR_RESOURCE_NOT_FOUND = -32002
CONST MCP_ERR_PROMPT_NOT_FOUND = -32003
CONST MCP_ERR_INVALID_TOOL_RESULT = -32004
CONST MCP_ERR_CANCELLED = -32005

#ENDIF
