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 };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Get') but doesn't cover aspects like whether this is a read-only operation, if it requires authentication, potential rate limits, or what happens if no context is set. This leaves significant gaps for a tool that likely interacts with system state.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action and details without any waste. It's appropriately sized for a simple tool with no parameters, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate but lacks depth. It explains what the tool does but doesn't address behavioral traits or output expectations, which could be important for context retrieval in a Gitea environment. It meets basic needs but has clear gaps in completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't add param details, maintaining focus on the tool's purpose without redundancy. A baseline of 4 is applied as it compensates adequately for the lack of parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and specifies the resource as 'current default context' with details (owner, repo, org, project), making the purpose explicit. However, it doesn't distinguish from sibling tools like 'gitea_user_current' which might retrieve user-specific context, leaving some ambiguity in differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as 'gitea_context_set' for setting context or 'gitea_user_current' for user-specific info. It lacks explicit context or exclusions, leaving usage implied rather than clearly defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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