|
27 | 27 | description: Operations related to repository labels |
28 | 28 | - name: Issues |
29 | 29 | description: Operations related to repository issues and pull requests |
| 30 | + - name: Repository |
| 31 | + description: Operations related to the repository itself |
30 | 32 |
|
31 | 33 | paths: |
32 | 34 | /docs: |
@@ -533,6 +535,39 @@ paths: |
533 | 535 | schema: |
534 | 536 | $ref: '#/components/schemas/ErrorResponse' |
535 | 537 |
|
| 538 | + /repository/viewer-permission: |
| 539 | + get: |
| 540 | + summary: Get Viewer Permission |
| 541 | + operationId: get_viewer_permission |
| 542 | + x-annotations: |
| 543 | + readOnlyHint: true |
| 544 | + description: | |
| 545 | + Retrieves the permission level of the currently authenticated user (viewer) for the repository. |
| 546 | +
|
| 547 | + **When to Use:** |
| 548 | + Call this tool to determine your capabilities before attempting a restricted action (e.g., assigning an issue, merging a PR). The agent is responsible for interpreting the returned permission level. |
| 549 | +
|
| 550 | + **Permission Levels:** |
| 551 | + - `ADMIN`: Can read, write, and manage the repository. |
| 552 | + - `MAINTAIN`: Can read, write, and manage issues and pull requests. |
| 553 | + - `WRITE`: Can read and write to the repository. |
| 554 | + - `TRIAGE`: Can manage issues and pull requests. |
| 555 | + - `READ`: Can read the repository. |
| 556 | + tags: [Repository] |
| 557 | + responses: |
| 558 | + '200': |
| 559 | + description: The viewer's permission level for the repository. |
| 560 | + content: |
| 561 | + application/json: |
| 562 | + schema: |
| 563 | + $ref: '#/components/schemas/ViewerPermissionResponse' |
| 564 | + '500': |
| 565 | + description: Internal server error. |
| 566 | + content: |
| 567 | + application/json: |
| 568 | + schema: |
| 569 | + $ref: '#/components/schemas/ErrorResponse' |
| 570 | + |
536 | 571 | components: |
537 | 572 | schemas: |
538 | 573 | HealthCheckResponse: |
@@ -816,3 +851,12 @@ components: |
816 | 851 | content: |
817 | 852 | type: string |
818 | 853 | description: The full markdown content of the issue file. |
| 854 | + |
| 855 | + ViewerPermissionResponse: |
| 856 | + type: object |
| 857 | + properties: |
| 858 | + permission: |
| 859 | + type: string |
| 860 | + description: The permission level of the viewer. |
| 861 | + enum: [ADMIN, MAINTAIN, WRITE, TRIAGE, READ] |
| 862 | + example: WRITE |
0 commit comments