Skip to main content
Glama

gitea_context_get

Retrieve the current default context including owner, repository, organization, and project details for Gitea operations.

Instructions

Get current default context (owner, repo, org, project)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'gitea_context_get' tool. Retrieves the current Gitea context from the ContextManager and returns it as a formatted JSON string in the MCP response format.
    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:483-500 (registration)
    Registration of the 'gitea_context_get' tool with the MCP server, including metadata (title, description) and the inline handler function.
    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), }, ], }; } );
  • Tool metadata schema defining the title and description for 'gitea_context_get'. No input schema is specified as the tool takes no arguments.
    { title: '获取当前上下文', description: 'Get current default context (owner, repo, org, project)', },
  • The ContextManager.getContext() method called by the handler, which returns a shallow copy of the internally stored GiteaContext object.
    getContext(): GiteaContext { return { ...this.context }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SupenBysz/gitea-mcp-tool'

If you have feedback or need assistance with the MCP directory API, please join our Discord server