Definition
Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Legacy.Generators Inheritance: System.ObjectSyntax
Summary
Generates CRUD (Create, Read, Update, Delete) MCP tools from OData entity types.Remarks
This generator creates MCP tools that allow AI models to perform basic data operations on OData entities. It generates separate tools for each CRUD operation, with proper validation, documentation, and parameter handling.Constructors
.ctor
Initializes a new instance of the CrudToolGenerator class.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
logger | Microsoft.Extensions.Logging.ILogger<Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerator> | The logger instance. |
.ctor Inherited
Inherited from
objectSyntax
Methods
Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
obj | object? | - |
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
GenerateAllCrudToolsAsync
Generates all CRUD tools for the specified entity set.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entitySet | Microsoft.OData.Mcp.Core.Models.EdmEntitySet | The entity set to generate tools for. |
entityType | Microsoft.OData.Mcp.Core.Models.EdmEntityType | The entity type definition. |
options | Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions | Options controlling tool generation behavior. |
cancellationToken | System.Threading.CancellationToken | Cancellation token for the operation. |
Returns
Type:System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.OData.Mcp.Core.Legacy.McpTool>>
A collection of generated MCP tools for CRUD operations.
GenerateCreateToolAsync
Generates a CREATE tool for the specified entity type.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entitySet | Microsoft.OData.Mcp.Core.Models.EdmEntitySet | The entity set to create entities in. |
entityType | Microsoft.OData.Mcp.Core.Models.EdmEntityType | The entity type definition. |
options | Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions | Options controlling tool generation behavior. |
cancellationToken | System.Threading.CancellationToken | Cancellation token for the operation. |
Returns
Type:System.Threading.Tasks.Task<Microsoft.OData.Mcp.Core.Legacy.McpTool>
A CREATE MCP tool for the entity type.
GenerateDeleteToolAsync
Generates a DELETE tool for the specified entity type.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entitySet | Microsoft.OData.Mcp.Core.Models.EdmEntitySet | The entity set containing entities to delete. |
entityType | Microsoft.OData.Mcp.Core.Models.EdmEntityType | The entity type definition. |
options | Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions | Options controlling tool generation behavior. |
cancellationToken | System.Threading.CancellationToken | Cancellation token for the operation. |
Returns
Type:System.Threading.Tasks.Task<Microsoft.OData.Mcp.Core.Legacy.McpTool>
A DELETE MCP tool for the entity type.
GenerateReadToolAsync
Generates a READ tool for the specified entity type.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entitySet | Microsoft.OData.Mcp.Core.Models.EdmEntitySet | The entity set to read entities from. |
entityType | Microsoft.OData.Mcp.Core.Models.EdmEntityType | The entity type definition. |
options | Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions | Options controlling tool generation behavior. |
cancellationToken | System.Threading.CancellationToken | Cancellation token for the operation. |
Returns
Type:System.Threading.Tasks.Task<Microsoft.OData.Mcp.Core.Legacy.McpTool>
A READ MCP tool for the entity type.
GenerateUpdateToolAsync
Generates an UPDATE tool for the specified entity type.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entitySet | Microsoft.OData.Mcp.Core.Models.EdmEntitySet | The entity set containing entities to update. |
entityType | Microsoft.OData.Mcp.Core.Models.EdmEntityType | The entity type definition. |
options | Microsoft.OData.Mcp.Core.Legacy.Generators.CrudToolGenerationOptions | Options controlling tool generation behavior. |
cancellationToken | System.Threading.CancellationToken | Cancellation token for the operation. |
Returns
Type:System.Threading.Tasks.Task<Microsoft.OData.Mcp.Core.Legacy.McpTool>
An UPDATE MCP tool for the entity type.
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?