Documentation Index Fetch the complete documentation index at: https://easyaf.dev/llms.txt
Use this file to discover all available pages before exploring further.
Definition
Assembly: Microsoft.OData.Mcp.Core.dll
Namespace: Microsoft.OData.Mcp.Core.Tools
Inheritance: System.Object
Syntax
Microsoft . OData . Mcp . Core . Tools . McpToolExample
Summary
Represents an example usage pattern for an MCP tool.
Examples help AI models understand how to use tools effectively and provide
better assistance to users by demonstrating common usage patterns.
Constructors
.ctor
Initializes a new instance of the McpToolExample class.
Syntax
.ctor
Initializes a new instance of the McpToolExample class with basic information.
Syntax
public McpToolExample ( string title , System . Text . Json . JsonDocument input )
Parameters
Name Type Description titlestringThe example title. inputSystem.Text.Json.JsonDocumentThe example input parameters.
Exceptions
Exception Description ArgumentExceptionThrown when title is null or whitespace. ArgumentNullExceptionThrown when input is null.
.ctor Inherited
Syntax
Properties
Category
Gets or sets the scenario category for this example.
Syntax
public string Category { get ; set ; }
Property Value
Type: string
The category that groups related examples together.
Common categories include “Basic Usage”, “Advanced Queries”, “Error Handling”,
“Performance Optimization”, etc. This helps organize examples by complexity or purpose.
Description
Gets or sets the description of the example.
Syntax
public string Description { get ; set ; }
Property Value
Type: string
A detailed description explaining the example’s purpose and context.
The description should provide context about when and why this
example would be useful, including any prerequisites or assumptions.
Difficulty
Gets or sets the difficulty level of this example.
Syntax
public Microsoft . OData . Mcp . Core . Tools . McpToolExampleDifficulty Difficulty { get ; set ; }
Property Value
Type: Microsoft.OData.Mcp.Core.Tools.McpToolExampleDifficulty
The complexity level of the example.
Difficulty levels help users and AI models choose appropriate examples
based on their experience and needs.
ExpectedExecutionTime
Gets or sets the expected execution time for this example.
Syntax
public System . Nullable < System . TimeSpan > ExpectedExecutionTime { get ; set ; }
Property Value
Type: System.Nullable<System.TimeSpan>
The approximate time this example should take to execute.
This helps set expectations and can be used for performance monitoring
and timeout configuration.
ExpectedOutput
Gets or sets the expected output for this example.
Syntax
public System . Text . Json . JsonDocument ExpectedOutput { get ; set ; }
Property Value
Type: System.Text.Json.JsonDocument?
A JSON document showing the expected result, or null if not provided.
Expected output helps users understand what to expect from the tool
and can be used for testing and validation purposes.
Gets or sets the example input parameters.
Syntax
public required System . Text . Json . JsonDocument Input { get ; set ; }
Property Value
Type: System.Text.Json.JsonDocument
A JSON document containing the example input parameters.
The input should be a complete, valid example that demonstrates
the tool’s parameter schema and typical usage patterns.
Notes
Gets or sets additional notes about this example.
Syntax
public string Notes { get ; set ; }
Property Value
Type: string?
Free-form notes providing additional context or warnings.
Notes can include tips, warnings about edge cases, performance considerations,
or links to related documentation.
Prerequisites
Gets or sets the prerequisites for this example.
Syntax
public System . Collections . Generic . List < string > Prerequisites { get ; set ; }
Property Value
Type: System.Collections.Generic.List<string>
A list of conditions that must be met for this example to work.
Prerequisites might include required permissions, data setup,
configuration settings, or other dependencies.
RequiresAuthentication
Gets or sets a value indicating whether this example requires authentication.
Syntax
public bool RequiresAuthentication { get ; set ; }
Property Value
Type: bool
true if authentication is required; otherwise, false.
This flag helps users and AI models understand whether they need
to provide authentication credentials to use this example.
Gets or sets the tags associated with this example.
Syntax
public System . Collections . Generic . List < string > Tags { get ; set ; }
Property Value
Type: System.Collections.Generic.List<string>
A collection of tags for categorizing and searching examples.
Tags provide flexible categorization beyond the main category,
allowing for cross-cutting concerns like “authentication”, “pagination”, “bulk-operations”, etc.
Title
Gets or sets the title of the example.
Syntax
public required string Title { get ; set ; }
Property Value
Type: string
A brief, descriptive title for the example.
The title should clearly indicate what the example demonstrates,
such as “Create a new customer” or “Query products by category”.
Methods
AddPrerequisite
Adds a prerequisite to this example.
Syntax
public void AddPrerequisite ( string prerequisite )
Parameters
Name Type Description prerequisitestringThe prerequisite to add.
Exceptions
Exception Description ArgumentExceptionThrown when prerequisite is null or whitespace.
AddTag
Adds a tag to this example.
Syntax
public void AddTag ( string tag )
Parameters
Name Type Description tagstringThe tag to add.
Exceptions
Exception Description ArgumentExceptionThrown when tag is null or whitespace.
Adds multiple tags to this example.
Syntax
public void AddTags ( params string [] tags )
Parameters
Name Type Description tagsstring[]The tags to add.
Exceptions
Exception Description ArgumentNullExceptionThrown when tags is null.
Clone
Creates a deep copy of this example.
Syntax
public Microsoft . OData . Mcp . Core . Tools . McpToolExample Clone ()
Returns
Type: Microsoft.OData.Mcp.Core.Tools.McpToolExample
A new instance that is a copy of this example.
Create
Creates a basic example with the specified title and input.
Syntax
public static Microsoft . OData . Mcp . Core . Tools . McpToolExample Create ( string title , object input , string description = null )
Parameters
Name Type Description titlestringThe example title. inputobjectThe input object to serialize to JSON. descriptionstring?Optional description of the example.
Returns
Type: Microsoft.OData.Mcp.Core.Tools.McpToolExample
A new tool example.
Exceptions
Exception Description ArgumentExceptionThrown when title is null or whitespace. ArgumentNullExceptionThrown when input is null.
CreateWithOutput
Creates an example with expected output.
Syntax
public static Microsoft . OData . Mcp . Core . Tools . McpToolExample CreateWithOutput ( string title , object input , object expectedOutput , string description = null )
Parameters
Name Type Description titlestringThe example title. inputobjectThe input object to serialize to JSON. expectedOutputobjectThe expected output object to serialize to JSON. descriptionstring?Optional description of the example.
Returns
Type: Microsoft.OData.Mcp.Core.Tools.McpToolExample
A new tool example with expected output.
Exceptions
Exception Description ArgumentExceptionThrown when title is null or whitespace. ArgumentNullExceptionThrown when input or expectedOutput is null.
Equals Inherited Virtual
Syntax
public virtual bool Equals ( object obj )
Parameters
Name Type Description objobject?-
Returns
Type: bool
Equals Inherited
Syntax
public static bool Equals ( object objA , object objB )
Parameters
Name Type Description objAobject?- objBobject?-
Returns
Type: bool
GetExpectedOutputJson
Gets the expected output as a formatted JSON string.
Syntax
public string GetExpectedOutputJson ( bool indent = true )
Parameters
Name Type Description indentboolWhether to indent the JSON for readability.
Returns
Type: string?
The expected output as a JSON string, or null if no expected output is defined.
GetHashCode Inherited Virtual
Syntax
public virtual int GetHashCode ()
Returns
Type: int
Gets the input as a formatted JSON string.
Syntax
public string GetInputJson ( bool indent = true )
Parameters
Name Type Description indentboolWhether to indent the JSON for readability.
Returns
Type: string
The input parameters as a JSON string.
GetType Inherited
Syntax
public System . Type GetType ()
Returns
Type: System.Type
HasTag
Determines whether this example has the specified tag.
Syntax
public bool HasTag ( string tag )
Parameters
Name Type Description tagstringThe tag to check for.
Returns
Type: bool
true if the example has the specified tag; otherwise, false.
MemberwiseClone Inherited
Syntax
protected internal object MemberwiseClone ()
Returns
Type: object
ReferenceEquals Inherited
Syntax
public static bool ReferenceEquals ( object objA , object objB )
Parameters
Name Type Description objAobject?- objBobject?-
Returns
Type: bool
ToString Override
Returns a string representation of the example.
Syntax
public override string ToString ()
Returns
Type: string
A summary of the example.
ToString Inherited Virtual
Syntax
public virtual string ToString ()
Returns
Type: string?
Validate
Validates the example for completeness and correctness.
Syntax
public System . Collections . Generic . IEnumerable < string > Validate ()
Returns
Type: System.Collections.Generic.IEnumerable<string>
A collection of validation errors, or empty if the example is valid.