Definition
Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.ToolsSyntax
Summary
Factory for creating MCP tools dynamically from OData metadata.Remarks
This factory generates MCP tools based on the parsed OData model, creating tools for CRUD operations, queries, and navigation between entities. The tools are generated dynamically to match the structure and capabilities of the OData service.Methods
FilterToolsForUser Abstract
Filters tools based on user authorization context.Syntax
Parameters
Returns
Type:System.Collections.Generic.IEnumerable<Microsoft.OData.Mcp.Core.Tools.McpToolDefinition>
A collection of tools the user is authorized to access.
Exceptions
GenerateCrudToolsAsync Abstract
Generates CRUD operation tools for a specific entity type.Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.OData.Mcp.Core.Tools.McpToolDefinition>>
A collection of CRUD tool definitions.
Exceptions
GenerateEntitySetToolsAsync Abstract
Generates tools for entity set operations (collection-level operations).Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.OData.Mcp.Core.Tools.McpToolDefinition>>
A collection of entity set tool definitions.
Exceptions
GenerateEntityToolsAsync Abstract
Generates MCP tools for a specific entity type.Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.OData.Mcp.Core.Tools.McpToolDefinition>>
A collection of generated MCP tool definitions for the entity type.
Exceptions
GenerateNavigationToolsAsync Abstract
Generates navigation tools for entity relationships.Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.OData.Mcp.Core.Tools.McpToolDefinition>>
A collection of navigation tool definitions.
Exceptions
GenerateQueryToolsAsync Abstract
Generates query tools for the OData model.Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.OData.Mcp.Core.Tools.McpToolDefinition>>
A collection of query tool definitions.
Exceptions
GenerateToolsAsync Abstract
Generates all MCP tools for the specified OData model.Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.OData.Mcp.Core.Tools.McpToolDefinition>>
A collection of generated MCP tool definitions.
Exceptions
GetAvailableToolNames Abstract
Gets all available tool names.Syntax
Returns
Type:System.Collections.Generic.IEnumerable<string>
A collection of all tool names that have been generated.
GetTool Abstract
Gets the tool definition by name.Syntax
Parameters
Returns
Type:Microsoft.OData.Mcp.Core.Tools.McpToolDefinition?
The tool definition if found; otherwise, null.
ValidateTools Abstract
Validates that the generated tools are compatible with the MCP specification.Syntax
Parameters
Returns
Type:System.Collections.Generic.IEnumerable<string>
A collection of validation errors, or empty if all tools are valid.