Definition
Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Server Inheritance: System.ObjectSyntax
Summary
Dynamic OData MCP tools that generate methods based on discovered OData metadata.Remarks
This class provides dynamically generated MCP tools based on the structure of OData services. It discovers entity sets, operations, and schemas to create contextual tools for AI models.Constructors
.ctor
Initializes a new instance of the DynamicODataMcpTools class.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
httpClientFactory | System.Net.Http.IHttpClientFactory | The HTTP client factory. |
configuration | Microsoft.Extensions.Options.IOptions<Microsoft.OData.Mcp.Core.Configuration.McpServerConfiguration> | The server configuration. |
metadataParser | Microsoft.OData.Mcp.Core.Parsing.ICsdlMetadataParser | The CSDL metadata parser. |
logger | Microsoft.Extensions.Logging.ILogger<Microsoft.OData.Mcp.Core.Server.DynamicODataMcpTools> | The logger instance. |
.ctor Inherited
Inherited from
objectSyntax
Methods
DescribeEntityType
Gets detailed schema information for a specific entity type.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entityTypeName | string | The name of the entity type to describe. |
Returns
Type:System.Threading.Tasks.Task<string>
Detailed schema information including properties, keys, and navigation properties.
DiscoverEntitySets
Discovers and lists all available entity sets in the OData service.Syntax
Returns
Type:System.Threading.Tasks.Task<string>
A JSON array of entity set information including names and types.
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
GenerateQueryExamples
Generates sample OData query URLs for a specific entity set.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
entitySetName | string | The name of the entity set. |
includeAdvanced | bool | Whether to include advanced query examples. |
Returns
Type:System.Threading.Tasks.Task<string>
A collection of sample OData query URLs with explanations.
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?
ValidateQuery
Validates an OData query URL against the service metadata.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
queryUrl | string | The OData query URL to validate. |
Returns
Type:System.Threading.Tasks.Task<string>
Validation results including any errors or warnings.