> ## Documentation Index
> Fetch the complete documentation index at: https://ai.easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# ODataMcpCatalog

> Builds MCP resources and tools from a Core EDM. Only declared model members are serialized into catalogs, schemas, and completions.

## Definition

**Assembly:** Microsoft.OData.Mcp.Core.dll

**Namespace:** Microsoft.OData.Mcp.Core.Catalog

**Inheritance:** System.Object

## Syntax

```csharp theme={null}
Microsoft.OData.Mcp.Core.Catalog.ODataMcpCatalog
```

## Summary

Builds MCP resources and tools from a Core EDM. Only declared model members
are serialized into catalogs, schemas, and completions.

## Constructors

### &#x20;.ctor

Initializes a new instance of the [ODataMcpCatalog](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Catalog/ODataMcpCatalog.md) class.

#### Syntax

```csharp theme={null}
public ODataMcpCatalog(Microsoft.OData.Mcp.Core.Models.EdmModel model, Microsoft.OData.Mcp.Core.Catalog.ODataMcpCatalogOptions options)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The Core EDM. |
| `options` | `Microsoft.OData.Mcp.Core.Catalog.ODataMcpCatalogOptions` | Catalog options. |

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *model* or *options* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |
| `ArgumentException` | Thrown when [ODataMcpCatalogOptions.RouteName](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Catalog/ODataMcpCatalogOptions.md#routename) is null, empty, or whitespace. |
| `ArgumentOutOfRangeException` | Thrown when [ODataMcpCatalogOptions.ToolsPageSize](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Catalog/ODataMcpCatalogOptions.md#toolspagesize) is not greater than zero. |

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public Object()
```

## Properties

### &#x20;Resources

Gets the resource descriptors.

#### Syntax

```csharp theme={null}
public System.Collections.Generic.IReadOnlyList<Microsoft.OData.Mcp.Core.Catalog.ODataResourceDescriptor> Resources { get; }
```

#### Property Value

Type: `System.Collections.Generic.IReadOnlyList<Microsoft.OData.Mcp.Core.Catalog.ODataResourceDescriptor>`

### &#x20;ResourceTemplates

Gets the resource templates.

#### Syntax

```csharp theme={null}
public System.Collections.Generic.IReadOnlyList<Microsoft.OData.Mcp.Core.Catalog.ODataResourceTemplateDescriptor> ResourceTemplates { get; }
```

#### Property Value

Type: `System.Collections.Generic.IReadOnlyList<Microsoft.OData.Mcp.Core.Catalog.ODataResourceTemplateDescriptor>`

### &#x20;Shapes

Gets the cached type shapes keyed by EDM full name. Empty when [ODataMcpCatalogOptions.IsDynamicModel](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Catalog/ODataMcpCatalogOptions.md#isdynamicmodel) is `true`.

#### Syntax

```csharp theme={null}
public System.Collections.Generic.IReadOnlyDictionary<string, Microsoft.OData.Mcp.Core.Catalog.EdmTypeShape> Shapes { get; }
```

#### Property Value

Type: `System.Collections.Generic.IReadOnlyDictionary<string, Microsoft.OData.Mcp.Core.Catalog.EdmTypeShape>`

### &#x20;Tools

Gets the tool descriptors (generic first, then named).

#### Syntax

```csharp theme={null}
public System.Collections.Generic.IReadOnlyList<Microsoft.OData.Mcp.Core.Catalog.ODataToolDescriptor> Tools { get; }
```

#### Property Value

Type: `System.Collections.Generic.IReadOnlyList<Microsoft.OData.Mcp.Core.Catalog.ODataToolDescriptor>`

## Methods

### &#x20;CompleteEntitySetNames

Completes entity set names for resource templates.

#### Syntax

```csharp theme={null}
public System.Collections.Generic.IReadOnlyList<string> CompleteEntitySetNames(string prefix)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `prefix` | `string` | The prefix typed so far. Empty means all declared sets. |

#### Returns

Type: `System.Collections.Generic.IReadOnlyList<string>`
Matching declared entity set names from the EDM. Never invents names.

### &#x20;Equals Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public virtual bool Equals(object obj)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `obj` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;Equals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;GetHashCode Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### &#x20;GetShape

Gets the shape for an entity type, from the cache when the model is static.

#### Syntax

```csharp theme={null}
public Microsoft.OData.Mcp.Core.Catalog.EdmTypeShape GetShape(Microsoft.OData.Mcp.Core.Models.EdmEntityType entityType)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `entityType` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type. |

#### Returns

Type: `Microsoft.OData.Mcp.Core.Catalog.EdmTypeShape`
The cached shape, or a freshly built one when [ODataMcpCatalogOptions.IsDynamicModel](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Catalog/ODataMcpCatalogOptions.md#isdynamicmodel) is `true`.

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *entityType* is null. |

### &#x20;GetType Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### &#x20;MemberwiseClone Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### &#x20;ReferenceEquals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;ToString Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={null}
public virtual string ToString()
```

#### Returns

Type: `string?`

### &#x20;TryGetTaskedAction

Resolves a tasked EDM action for a named `action_*` tool or `odata_call` of the same action.

#### Syntax

```csharp theme={null}
public bool TryGetTaskedAction(string toolName, System.Collections.Generic.IReadOnlyDictionary<string, System.Text.Json.JsonElement> arguments, out Microsoft.OData.Mcp.Core.Models.EdmAction action)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `toolName` | `string` | The MCP tool name. |
| `arguments` | `System.Collections.Generic.IReadOnlyDictionary<string, System.Text.Json.JsonElement>` | The call arguments, used to read `name` on `odata_call`. |
| `action` | `Microsoft.OData.Mcp.Core.Models.EdmAction?` | The tasked action when found. |

#### Returns

Type: `bool`
`true` when the resolved tool is an annotated action.

#### Remarks

CRUD tools, functions, and unannotated actions return `false`. Named
`action_*` and `odata_call` of the same annotated action share this path.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.