> ## 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.

# ServiceProbe

> Answers four questions about an OData service with three requests: is `$metadata` reachable, is the data reachable, is either of them secured, and does a rea...

## Definition

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

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

**Inheritance:** System.Object

## Syntax

```csharp theme={null}
Microsoft.OData.Mcp.Core.Diagnostics.ServiceProbe
```

## Summary

Answers four questions about an OData service with three requests: is `$metadata` reachable, is the
data reachable, is either of them secured, and does a real row look like the model says it should.

## Remarks

The probe uses whatever [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient) it is given. Pass a plain client to learn what an anonymous
caller sees; pass the authenticated OData client to learn what the catalog will see. It never throws for a
service that misbehaves; every failure lands in a [ProbeStep](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Diagnostics/ProbeStep.md).

## Examples

```csharp theme={null}
var probe = new ServiceProbe(httpClient, new CsdlParser());
var result = await probe.ProbeAsync(new Uri("https://services.odata.org/V4/Northwind/Northwind.svc/"), ct);
Console.WriteLine(result.Verdict); // Ready
```

## Constructors

### &#x20;.ctor

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

#### Syntax

```csharp theme={null}
public ServiceProbe(System.Net.Http.HttpClient client, Microsoft.OData.Mcp.Core.Parsing.CsdlParser parser)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `client` | `System.Net.Http.HttpClient` | The client every request goes through. |
| `parser` | `Microsoft.OData.Mcp.Core.Parsing.CsdlParser` | The CSDL parser. |

### &#x20;.ctor Inherited

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

#### Syntax

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

## Methods

### &#x20;ChooseEntitySet

Picks the entity set to sample: the first one the container declares whose type the model resolves.

#### Syntax

```csharp theme={null}
public static System.Nullable<(Microsoft.OData.Mcp.Core.Models.EdmEntitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType)> ChooseEntitySet(Microsoft.OData.Mcp.Core.Models.EdmModel model)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The model. |

#### Returns

Type: `System.Nullable<(Microsoft.OData.Mcp.Core.Models.EdmEntitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType)>`
The set and its type, or `null` when the model declares no usable set.

### &#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;GetType Inherited

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

#### Syntax

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

#### Returns

Type: `System.Type`

### &#x20;InterpretRow

Checks a data response body against the model: is it JSON, is it an OData collection, and do the first
row's property names belong to the type.

#### Syntax

```csharp theme={null}
public static Microsoft.OData.Mcp.Core.Diagnostics.ProbeStep InterpretRow(Microsoft.OData.Mcp.Core.Models.EdmEntityType type, string json)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `type` | `Microsoft.OData.Mcp.Core.Models.EdmEntityType` | The entity type behind the sampled set. |
| `json` | `string` | The response body. |

#### Returns

Type: `Microsoft.OData.Mcp.Core.Diagnostics.ProbeStep`
[ProbeOutcome.Passed](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Diagnostics/ProbeOutcome.md#passed) when the row's properties are declared on the type (an empty set also
passes, with a note); [ProbeOutcome.Unreadable](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Core/Diagnostics/ProbeOutcome.md#unreadable) when the body is not JSON, has no
`value` array, or shares no property names with the type.

### &#x20;MemberwiseClone Inherited

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

#### Syntax

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

#### Returns

Type: `object`

### &#x20;ProbeAsync

Runs all three steps.

#### Syntax

```csharp theme={null}
public System.Threading.Tasks.Task<Microsoft.OData.Mcp.Core.Diagnostics.ServiceProbeResult> ProbeAsync(System.Uri serviceRoot, System.Threading.CancellationToken cancellationToken)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `serviceRoot` | `System.Uri` | The service root; a trailing slash is added when missing. |
| `cancellationToken` | `System.Threading.CancellationToken` | The cancellation token. |

#### Returns

Type: `System.Threading.Tasks.Task<Microsoft.OData.Mcp.Core.Diagnostics.ServiceProbeResult>`
The result. Never throws for a misbehaving service.

### &#x20;ProbeWithModelAsync

Runs steps 2 and 3 against a model that is already parsed, for hosts that fetched `$metadata` themselves.

#### Syntax

```csharp theme={null}
public System.Threading.Tasks.Task<Microsoft.OData.Mcp.Core.Diagnostics.ServiceProbeResult> ProbeWithModelAsync(System.Uri serviceRoot, Microsoft.OData.Mcp.Core.Models.EdmModel model, System.Threading.CancellationToken cancellationToken)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `serviceRoot` | `System.Uri` | The service root. |
| `model` | `Microsoft.OData.Mcp.Core.Models.EdmModel` | The parsed model. |
| `cancellationToken` | `System.Threading.CancellationToken` | The cancellation token. |

#### Returns

Type: `System.Threading.Tasks.Task<Microsoft.OData.Mcp.Core.Diagnostics.ServiceProbeResult>`
A result whose metadata step is recorded as passed.

### &#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?`


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