Skip to main content
Glama

gitea_context_set

Set default context for Gitea operations by configuring owner, repository, organization, or project parameters to streamline subsequent interactions.

Instructions

Set default context for subsequent operations. All parameters are optional.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerNoDefault owner (username or organization)
repoNoDefault repository name
orgNoDefault organization name
projectNoDefault project ID

Implementation Reference

  • Handler function for the 'gitea_context_set' tool. Retrieves the old context, sets the new context using ctx.contextManager.setContext(args), retrieves the new context, and returns a JSON response with old and new contexts.
    async (args) => { const oldContext = ctx.contextManager.getContext(); ctx.contextManager.setContext(args); const newContext = ctx.contextManager.getContext(); return { content: [ { type: 'text' as const, text: JSON.stringify( { success: true, message: 'Context updated successfully', oldContext, newContext, }, null, 2 ), }, ], }; }
  • Zod input schema defining optional parameters: owner, repo, org, project for setting the default context.
    inputSchema: z.object({ owner: z.string().optional().describe('Default owner (username or organization)'), repo: z.string().optional().describe('Default repository name'), org: z.string().optional().describe('Default organization name'), project: z.number().optional().describe('Default project ID'), }),
  • src/index.ts:503-538 (registration)
    Registration of the 'gitea_context_set' tool using mcpServer.registerTool, including title, description, input schema, and inline handler function.
    mcpServer.registerTool( 'gitea_context_set', { title: '设置默认上下文', description: 'Set default context for subsequent operations. All parameters are optional.', inputSchema: z.object({ owner: z.string().optional().describe('Default owner (username or organization)'), repo: z.string().optional().describe('Default repository name'), org: z.string().optional().describe('Default organization name'), project: z.number().optional().describe('Default project ID'), }), }, async (args) => { const oldContext = ctx.contextManager.getContext(); ctx.contextManager.setContext(args); const newContext = ctx.contextManager.getContext(); return { content: [ { type: 'text' as const, text: JSON.stringify( { success: true, message: 'Context updated successfully', oldContext, newContext, }, null, 2 ), }, ], }; } );

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