gitea_context_get
Retrieve the current default context (owner, repository, organization, project) for Gitea repository operations.
Instructions
Get current default context (owner, repo, org, project)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:483-500 (registration)Registration of the 'gitea_context_get' tool using mcpServer.registerTool, including title, description, and the inline handler function that retrieves and returns the current context as JSON.mcpServer.registerTool( 'gitea_context_get', { title: '获取当前上下文', description: 'Get current default context (owner, repo, org, project)', }, async (_args: any, _extra: any) => { const context = ctx.contextManager.getContext(); return { content: [ { type: 'text' as const, text: JSON.stringify(context, null, 2), }, ], }; } );
- src/index.ts:489-499 (handler)The core handler function for 'gitea_context_get' that gets the current context from ctx.contextManager and serializes it to JSON in the tool response.async (_args: any, _extra: any) => { const context = ctx.contextManager.getContext(); return { content: [ { type: 'text' as const, text: JSON.stringify(context, null, 2), }, ], }; }