Definition
Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Legacy.Generators Inheritance: System.ObjectSyntax
Summary
Generates query MCP tools from OData entity types.Remarks
This generator creates MCP tools that allow AI models to perform advanced querying operations on OData entities, including filtering, sorting, projection, and expansion. It supports all standard OData query options like orderby, expand, skip, and $search.Constructors
.ctor
Initializes a new instance of the QueryToolGenerator class.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
logger | Microsoft.Extensions.Logging.ILogger<Microsoft.OData.Mcp.Core.Legacy.Generators.QueryToolGenerator> | 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
GenerateAllQueryToolsAsync
Generates all query 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.QueryToolGenerationOptions | 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 query operations.
GenerateCountToolAsync
Generates a count tool for getting entity counts with optional filtering.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entitySet | Microsoft.OData.Mcp.Core.Models.EdmEntitySet | The entity set to count. |
entityType | Microsoft.OData.Mcp.Core.Models.EdmEntityType | The entity type definition. |
options | Microsoft.OData.Mcp.Core.Legacy.Generators.QueryToolGenerationOptions | 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 count MCP tool for the entity type.
GenerateListToolAsync
Generates a query tool for listing entities with filtering and sorting.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entitySet | Microsoft.OData.Mcp.Core.Models.EdmEntitySet | The entity set to query. |
entityType | Microsoft.OData.Mcp.Core.Models.EdmEntityType | The entity type definition. |
options | Microsoft.OData.Mcp.Core.Legacy.Generators.QueryToolGenerationOptions | 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 query MCP tool for the entity type.
GenerateSearchToolAsync
Generates a search tool for full-text search across entity properties.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entitySet | Microsoft.OData.Mcp.Core.Models.EdmEntitySet | The entity set to search. |
entityType | Microsoft.OData.Mcp.Core.Models.EdmEntityType | The entity type definition. |
options | Microsoft.OData.Mcp.Core.Legacy.Generators.QueryToolGenerationOptions | 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 search 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?