Skip to main content
Glama
MarveleE
by MarveleE

rap2_test_connection

Test connection to RAP2 API server and validate session by probing repository endpoints, automatically logging in if required.

Instructions

测试连接并校验会话:探测 /repository/joined,必要时自动登录后再探测(可用提示:"测试rap连接"、"确保已登录")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Executes the rap2_test_connection tool: creates Rap2Client, probes /repository/joined endpoint, auto-logins if needed, returns {ok, status, didLogin} as JSON text.
    if (name === 'rap2_test_connection') {
      const client = createClient();
      const probe = async () => client._fetch('/repository/joined');
      let res = await probe();
      const looksLikeHtml = !!res?.data?.raw;
      const notOk = res?.status !== 200 || looksLikeHtml || res?.data?.isOk === false;
      let didLogin = false;
      if (notOk) {
        const login = await client.login();
        didLogin = !login?.error;
        res = await probe();
      }
      const ok = res?.status === 200 && !res?.data?.raw;
      const payload = { ok, status: res?.status ?? 0, didLogin };
      logger.info({ tool: name, result: payload }, 'tool success');
      return { content: [{ type: 'text', text: JSON.stringify(payload) }] };
    }
  • Tool metadata including name, description, and empty inputSchema (no parameters). Used for tool listing and validation.
      name: 'rap2_test_connection',
      description: '测试连接并校验会话:探测 /repository/joined,必要时自动登录后再探测(可用提示:\"测试rap连接\"、\"确保已登录\")',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Registers the tools list (including rap2_test_connection) in the MCP server's capabilities for tool discovery.
    const server = new Server(
      { name: 'rap2-mcp-tool', version: '0.1.9' },
      { capabilities: { tools: { list: tools } } },
    );
Behavior3/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 describes key behaviors: probing a specific endpoint, automatic login if necessary, and example prompts for use. However, it lacks details on error handling, response format, or any rate limits or permissions required. The description adds some context but doesn't fully compensate for the absence of annotations, leaving gaps in understanding the tool's operational traits.

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

Conciseness4/5

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

The description is concise and front-loaded, stating the core action in the first clause. It includes useful example prompts without unnecessary elaboration. However, the inclusion of Chinese prompts might reduce clarity for non-Chinese speakers, and the structure could be slightly improved by separating the action from the usage hints more clearly.

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 complexity (involving connection testing and automatic login), no annotations, no output schema, and 0 parameters, the description is moderately complete. It covers the what and how but lacks details on return values, error cases, or how it differs from siblings. For a tool with potential side effects (like automatic login), more behavioral context would be beneficial to ensure safe and correct usage by an AI agent.

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 discuss parameters, focusing instead on the tool's action and context. This aligns with the baseline expectation for tools with no parameters, where the description should not waste space on non-existent inputs.

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 tool's purpose: testing connection and validating session by probing /repository/joined, with automatic login if needed. It uses specific verbs ('测试连接并校验会话', '探测', '自动登录') and identifies the resource ('/repository/joined'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like rap2_ensure_session, which might have overlapping functionality.

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

Usage Guidelines3/5

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

The description implies usage context through example prompts ('测试rap连接', '确保已登录'), suggesting this tool is for verifying connectivity and session status. However, it doesn't provide explicit guidance on when to use this versus alternatives like rap2_ensure_session or rap2_debug_login_info, nor does it specify prerequisites or exclusions. The usage is implied but not clearly articulated.

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