NotionMCPToolkit

class NotionMCPToolkit(BaseToolkit):
NotionMCPToolkit provides an interface for interacting with Notion through the Model Context Protocol (MCP). Parameters:
  • timeout (Optional[float]): Connection timeout in seconds. (default: :obj:None)
Note: Currently only supports asynchronous operation mode.

init

def __init__(self, timeout: Optional[float] = None):
Initializes the NotionMCPToolkit. Parameters:
  • timeout (Optional[float]): Connection timeout in seconds. (default: :obj:None)

get_tools

def get_tools(self):
Returns: List[FunctionTool]: List of available tools.

_build_notion_tool_schema

def _build_notion_tool_schema(self, mcp_tool, original_build_schema):
Build tool schema with Notion-specific fixes.

_fix_notion_schema_recursively

def _fix_notion_schema_recursively(self, obj: Any):
Recursively fix Notion MCP schema issues.

_fix_dict_schema

def _fix_dict_schema(self, obj: Dict[str, Any]):
Fix dictionary schema issues.

_fix_missing_type_with_properties

def _fix_missing_type_with_properties(self, obj: Dict[str, Any]):
Fix objects with properties but missing type field.

_fix_object_with_properties

def _fix_object_with_properties(self, obj: Dict[str, Any]):
Fix objects with type=“object” and properties.

_get_required_properties

def _get_required_properties(self, properties: Dict[str, Any], conservative: bool = False):
Get list of required properties from a properties dict.

_is_property_required

def _is_property_required(self, prop_schema: Dict[str, Any]):
Check if a property should be marked as required.

_process_nested_structures

def _process_nested_structures(self, obj: Dict[str, Any]):
Process all nested structures in a schema object.