Skip to main content
Glama
MarveleE
by MarveleE

rap2_get_repository_interfaces

Retrieve all interface lists from a specified repository in RAP2 API documentation to access and manage API endpoints efficiently.

Instructions

获取仓库下的全部接口列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repositoryIdYes仓库 ID(传入字符串)

Implementation Reference

  • Core implementation: Fetches the repository by ID, extracts modules, and flattens all interfaces.
    async getRepositoryInterfaces(repositoryId) {
      const res = await this._fetch(`/repository/get?id=${encodeURIComponent(repositoryId)}`);
      const body = res?.data || {};
      if (body.errMsg) return { error: body.errMsg };
      const repo = body.data || {};
      const modules = Array.isArray(repo.modules) ? repo.modules : [];
      const interfaces = modules.flatMap(m => Array.isArray(m.interfaces) ? m.interfaces : []);
      return interfaces;
    }
  • MCP server tool handler: Normalizes input, calls Rap2Client.getRepositoryInterfaces, handles errors, and formats response.
    if (name === 'rap2_get_repository_interfaces') {
      const { repositoryId } = (req.params.arguments || {});
      const normalizedId = validateAndNormalizeId('repositoryId', repositoryId);
    
      const client = createClient();
      const result = await client.getRepositoryInterfaces(normalizedId);
    
      if (result?.error) {
        const errorMsg = String(result.error);
        logger.error({ tool: name, repositoryId: normalizedId, error: errorMsg }, 'tool failed');
        throw new Error(`获取仓库接口失败: ${errorMsg}`);
      }
    
      logger.info({ tool: name, repositoryId: normalizedId, resultCount: Array.isArray(result) ? result.length : 0 }, 'tool success');
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
  • Tool schema definition including input schema for repositoryId.
    {
      name: 'rap2_get_repository_interfaces',
      description: '获取仓库下的全部接口列表',
      inputSchema: {
        type: 'object',
        properties: {
          repositoryId: { type: 'string', description: '仓库 ID(传入字符串)' },
        },
        required: ['repositoryId'],
      },
    },
  • Server initialization registering the tools list which includes this tool.
    const server = new Server(
      { name: 'rap2-mcp-tool', version: '0.1.9' },
      { capabilities: { tools: { list: tools } } },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it retrieves a list, implying a read-only operation, but doesn't specify whether it requires authentication, pagination behavior, rate limits, error conditions, or the format of the returned list. For a tool with no annotation coverage, this leaves significant gaps in understanding how it behaves.

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 in Chinese that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to understand at a glance. Every part of the sentence contributes to clarifying the tool's function.

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

Completeness2/5

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

Given the tool has no annotations, no output schema, and a simple input schema, the description is incomplete. It doesn't address behavioral aspects like authentication needs (implied by sibling tools), error handling, or the structure of the returned interface list. For a tool that likely interacts with a repository system, more context on usage and output is needed to be fully helpful.

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

Parameters3/5

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

Schema description coverage is 100%, with the single parameter 'repositoryId' documented in the schema as '仓库 ID(传入字符串)' meaning 'repository ID (pass as string)'. The description doesn't add any additional meaning beyond this, such as where to find the ID or examples of valid values. Since the schema fully describes the parameter, the baseline score of 3 is appropriate.

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 action ('获取' meaning 'get' or 'retrieve') and the resource ('仓库下的全部接口列表' meaning 'all interface lists under the repository'). It specifies the scope ('全部' meaning 'all') which helps distinguish it from sibling tools like rap2_get_interface_by_id (which gets a single interface) and rap2_search_interfaces_by_keyword/path (which search with filters). However, it doesn't explicitly differentiate from rap2_search_interfaces_by_keyword/path in terms of when to use one over the other.

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. It doesn't mention prerequisites (e.g., whether authentication is needed, though sibling tools like rap2_ensure_session suggest session management), or compare it to sibling tools like rap2_search_interfaces_by_keyword/path for filtered searches. Usage is implied only by the tool name and description context.

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/MarveleE/rap2-mcp'

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