Skip to content

Commit bf938c3

Browse files
committed
Enhance GitHub Workflow OpenAPI Spec with Rich Descriptions #7623
1 parent 07f07f1 commit bf938c3

1 file changed

Lines changed: 76 additions & 18 deletions

File tree

ai/mcp/server/github-workflow/openapi.yaml

Lines changed: 76 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ openapi: 3.0.3
22
info:
33
title: Neo.mjs GitHub Workflow MCP Server API
44
description: |
5-
This API provides structured access to the GitHub CLI (`gh`) to streamline and automate
6-
contribution workflows for the Neo.mjs project. It enables AI agents to interact with
7-
pull requests and issues programmatically.
5+
This API provides structured access to the Neo.mjs GitHub repository, enabling the automation of contribution workflows.
6+
It uses a hybrid approach, leveraging both the GitHub CLI (`gh`) for simple, direct commands (e.g., checking out a PR)
7+
and the GitHub GraphQL API for complex data fetching and mutations (e.g., listing PRs, creating comments, syncing issues).
8+
This allows AI agents to programmatically interact with pull requests and issues in a safe and efficient manner.
89
version: 1.0.0
910
contact:
1011
name: Neo.mjs Project
@@ -48,8 +49,10 @@ paths:
4849
x-annotations:
4950
readOnlyHint: true
5051
description: |
51-
Verifies that the GitHub CLI (`gh`) is installed, authenticated, and
52-
meets the minimum version requirement. Use this to diagnose setup issues.
52+
Verifies that the GitHub CLI (`gh`) is installed, authenticated, and meets the minimum version requirement.
53+
54+
**When to Use:**
55+
This should be the first tool you run if you suspect any issues with the GitHub Workflow MCP server. It provides a quick diagnostic check on the server's primary dependency.
5356
tags: [Health]
5457
responses:
5558
'200':
@@ -71,7 +74,11 @@ paths:
7174
operationId: list_labels
7275
x-annotations:
7376
readOnlyHint: true
74-
description: Retrieves a list of all available labels in the repository.
77+
description: |
78+
Retrieves a list of all available labels in the repository.
79+
80+
**When to Use:**
81+
This is a crucial discovery tool. Call it before using `create_issue` or `add_labels` to ensure you are using valid, existing label names.
7582
tags: [Labels]
7683
responses:
7784
'200':
@@ -94,7 +101,11 @@ paths:
94101
x-pass-as-object: true
95102
x-annotations:
96103
readOnlyHint: true
97-
description: Retrieves a list of open pull requests from the GitHub repository.
104+
description: |
105+
Retrieves a list of pull requests from the GitHub repository.
106+
107+
**When to Use:**
108+
Use this tool to get a high-level overview of pending work or to find a specific pull request number for use in other tools like `get_pull_request_diff` or `checkout_pull_request`.
98109
tags: [Pull Requests]
99110
parameters:
100111
- name: limit
@@ -134,7 +145,12 @@ paths:
134145
operationId: checkout_pull_request
135146
x-annotations:
136147
readOnlyHint: false
137-
description: Checks out the branch for a given pull request locally using `gh pr checkout`.
148+
description: |
149+
Checks out the branch for a given pull request locally using `gh pr checkout`.
150+
This modifies the local filesystem to reflect the state of the pull request branch.
151+
152+
**When to Use:**
153+
Use this tool when you need to locally inspect the code changes of a pull request, run tests, or perform a more detailed review.
138154
tags: [Pull Requests]
139155
parameters:
140156
- name: pr_number
@@ -170,7 +186,12 @@ paths:
170186
operationId: get_pull_request_diff
171187
x-annotations:
172188
readOnlyHint: true
173-
description: Retrieves the diff for a specific pull request using `gh pr diff`.
189+
description: |
190+
Retrieves the diff for a specific pull request using `gh pr diff`.
191+
This provides a quick, read-only overview of the changes without checking out the branch.
192+
193+
**When to Use:**
194+
Use this tool for a quick review of the changes in a pull request. For a more in-depth review, use `checkout_pull_request`.
174195
tags: [Pull Requests]
175196
parameters:
176197
- name: pr_number
@@ -206,7 +227,11 @@ paths:
206227
operationId: create_comment
207228
x-annotations:
208229
readOnlyHint: false
209-
description: Adds a comment to a specific pull request.
230+
description: |
231+
Adds a comment to a specific pull request.
232+
233+
**When to Use:**
234+
Use this tool to add review comments, ask questions, or provide feedback on a pull request.
210235
tags: [Pull Requests]
211236
parameters:
212237
- name: pr_number
@@ -255,7 +280,11 @@ paths:
255280
operationId: get_conversation
256281
x-annotations:
257282
readOnlyHint: true
258-
description: Retrieves the full conversation for a pull request, including the title, body, and all comments.
283+
description: |
284+
Retrieves the full conversation for a pull request, including the title, body, and all comments.
285+
286+
**When to Use:**
287+
Use this tool to get the complete context of a pull request, including the initial proposal and the full discussion history, which is essential for a comprehensive review.
259288
tags: [Pull Requests]
260289
parameters:
261290
- name: pr_number
@@ -279,7 +308,11 @@ paths:
279308
operationId: add_labels
280309
x-annotations:
281310
readOnlyHint: false
282-
description: Adds one or more labels to a specific issue or pull request.
311+
description: |
312+
Adds one or more labels to a specific issue or pull request.
313+
314+
**Important:** You must use the exact names of labels that already exist in the repository.
315+
Use the `list_labels` tool to get a list of available labels if you are unsure.
283316
tags: [Issues]
284317
parameters:
285318
- name: issue_number
@@ -327,7 +360,11 @@ paths:
327360
x-annotations:
328361
readOnlyHint: false
329362
destructiveHint: true
330-
description: Removes one or more labels from a specific issue or pull request.
363+
description: |
364+
Removes one or more labels from a specific issue or pull request.
365+
366+
**Important:** You must use the exact names of labels that already exist in the repository.
367+
Use the `list_labels` tool to see which labels are currently on an issue or to verify their names.
331368
tags: [Issues]
332369
parameters:
333370
- name: issue_number
@@ -376,7 +413,13 @@ paths:
376413
operationId: get_local_issue_by_id
377414
x-annotations:
378415
readOnlyHint: true
379-
description: Retrieves the full markdown content of a local issue file by its number, searching both active and archived issues.
416+
description: |
417+
Retrieves the full markdown content of a local issue file by its number, searching both active and archived issues.
418+
419+
**When to Use:**
420+
Use this tool for a fast, offline-capable way to read the content of an issue that is already present on the local disk. This tool reads directly from the file system and does **not** access the GitHub API.
421+
422+
**Important:** The content returned reflects the state of the issue at the time of the last `sync_all` operation and may not be the most up-to-date version if remote changes have occurred since.
380423
tags: [Issues]
381424
parameters:
382425
- name: issue_number
@@ -412,7 +455,16 @@ paths:
412455
x-pass-as-object: true
413456
x-annotations:
414457
readOnlyHint: false
415-
description: Creates a new GitHub issue with the given title, body, and labels.
458+
description: |
459+
Creates a new issue on GitHub. This is the authoritative first step for creating a new ticket.
460+
461+
**Workflow:**
462+
1. Call this tool (`create_issue`) to create the issue on GitHub.
463+
2. Call the `sync_all` tool to create the corresponding local Markdown file.
464+
465+
**Important:**
466+
The `labels` array must only contain labels that already exist in the repository.
467+
If you are unsure about the available labels, use the `list_labels` tool first.
416468
tags: [Issues]
417469
requestBody:
418470
required: true
@@ -457,9 +509,15 @@ paths:
457509
x-annotations:
458510
readOnlyHint: false
459511
description: |
460-
Triggers the bi-directional synchronization process for GitHub issues.
461-
Pushes local Markdown file changes to GitHub and pulls the latest issue
462-
and comment data from GitHub to the local files.
512+
Triggers the full, bi-directional synchronization of GitHub issues and releases with the local filesystem.
513+
This is a comprehensive operation that should be run after making remote changes (e.g., using `create_issue`)
514+
or before looking for local changes to push.
515+
516+
**Key Functions:**
517+
- **Pulls remote changes:** Fetches the latest issue and release data from GitHub.
518+
- **Creates local files:** If a new issue was created on GitHub (e.g., via the `create_issue` tool), this process will create the corresponding local `.md` file.
519+
- **Pushes local changes:** Scans for modifications in local issue files (in the active `ISSUE` directory only) and pushes them to GitHub.
520+
- **Efficient:** Uses a metadata cache and content hashing to ensure that only actual changes are pushed or pulled, making it fast for no-op runs.
463521
tags: [Issues]
464522
responses:
465523
'200':

0 commit comments

Comments
 (0)