Implementation:Microsoft Semantic kernel AgentMigration OpenAPI Spec
| Knowledge Sources | |
|---|---|
| Domains | OpenAPI, Agent_Framework |
| Last Updated | 2026-02-11 00:00 GMT |
Overview
Concrete OpenAPI 3.0.1 specification for the GitHub Versions API used as a tool-call sample in the Agent Framework Migration samples provided by the Semantic Kernel repository.
Description
This file is an OpenAPI 3.0.1 JSON specification that describes a subset of the GitHub REST API. It defines two endpoints:
- GET /repos/{owner}/{repo}/tags -- Lists repository tags with pagination support.
- GET /repos/{owner}/{repo}/labels -- Lists labels for a repository with pagination support.
The specification includes reusable components for schemas (basic-error, label, tag), parameters (owner, repo, per-page, page), example data, response definitions, and link headers. The server URL points to https://api.github.com.
This file is part of the Step04_ToolCall_WithOpenAPI sample in the Agent Framework Migration section, demonstrating how to use OpenAPI specifications as tool definitions that AI agents can call during conversations.
Usage
This file is used when running the Agent Framework Migration sample Step04_ToolCall_WithOpenAPI. The sample loads this OpenAPI specification to register GitHub API operations as callable tools for an Azure OpenAI-powered agent. Developers studying how to migrate from the legacy agent framework to the new one can reference this file to understand OpenAPI-based tool calling patterns.
Code Reference
Source Location
- Repository: Microsoft_Semantic_kernel
- File: dotnet/samples/AgentFrameworkMigration/AzureOpenAI/Step04_ToolCall_WithOpenAPI/OpenAPISpec.json
- Lines: 1-354
Signature
{
"openapi": "3.0.1",
"info": {
"title": "Github Versions API",
"version": "1.0.0"
},
"servers": [
{ "url": "https://api.github.com" }
],
"components": {
"schemas": {
"basic-error": {
"title": "Basic Error",
"type": "object",
"properties": {
"message": { "type": "string" },
"documentation_url": { "type": "string" },
"url": { "type": "string" },
"status": { "type": "string" }
}
},
"label": { "title": "Label", "type": "object" },
"tag": { "title": "Tag", "type": "object" }
}
},
"paths": {
"/repos/{owner}/{repo}/tags": { "get": { "operationId": "repos/list-tags" } },
"/repos/{owner}/{repo}/labels": { "get": { "operationId": "issues/list-labels-for-repo" } }
}
}
Import
// In the Step04_ToolCall_WithOpenAPI sample, the spec is loaded as an embedded resource or from file:
using var stream = File.OpenRead("OpenAPISpec.json");
// Then registered as an OpenAPI plugin with the Kernel:
await kernel.ImportPluginFromOpenApiAsync("GitHubPlugin", stream);
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| owner | string (path) | yes | The account owner of the repository. Not case sensitive. |
| repo | string (path) | yes | The name of the repository without the .git extension. Not case sensitive. |
| per_page | integer (query) | no | The number of results per page (max 100). Default: 30. |
| page | integer (query) | no | The page number of results to fetch. Default: 1. |
Outputs
| Name | Type | Description |
|---|---|---|
| tags | array of tag objects | List of repository tags, each containing name, commit (sha, url), zipball_url, tarball_url, and node_id. |
| labels | array of label objects | List of repository labels, each containing id, node_id, url, name, description, color, and default flag. |
| Link header | string | Pagination link header for navigating result pages. |
Usage Examples
Listing Repository Tags via the API
GET https://api.github.com/repos/microsoft/semantic-kernel/tags?per_page=5&page=1
Response: [
{
"name": "v1.0.0",
"commit": { "sha": "abc123...", "url": "https://api.github.com/repos/..." },
"zipball_url": "https://github.com/.../zipball/v1.0.0",
"tarball_url": "https://github.com/.../tarball/v1.0.0",
"node_id": "MDQ6..."
}
]
Using in Agent Framework Migration Sample
// Step04_ToolCall_WithOpenAPI demonstrates loading this spec:
var kernel = Kernel.CreateBuilder()
.AddAzureOpenAIChatCompletion(deploymentName, endpoint, apiKey)
.Build();
using var stream = File.OpenRead("OpenAPISpec.json");
await kernel.ImportPluginFromOpenApiAsync("GitHubPlugin", stream);