Skip to main content
Glama

get_current_document_info

Retrieve details of the active Revit view, including type, name, and scale, to understand the current document context for project tasks.

Instructions

获取 Revit 当前活动视图的详细信息,包括视图类型、名称、比例等属性。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The inline async handler for the get_current_document_info MCP tool. It connects to Revit via withRevitConnection, sends the 'get_current_document_info' command, formats the response as text content, and handles errors.
    server.tool('get_current_document_info', '获取 Revit 当前活动视图的详细信息,包括视图类型、名称、比例等属性。', {}, async (args, extra) => {
      console.error('[DEBUG] Tool get_current_document_info called with args:', args);
      try {
        console.error('[DEBUG] Establishing connection to Revit');
        const response = await withRevitConnection(async (revitClient) => {
          console.error('[DEBUG] Sending get_current_document_info command to Revit');
          return await revitClient.sendCommand('get_current_document_info', {});
        });
    
        console.error('[DEBUG] Received response from Revit:', JSON.stringify(response).substring(0, 200) + '...');
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(response, null, 2),
            },
          ],
        };
      } catch (error) {
        console.error('[DEBUG] Error in get_current_document_info:', error);
        return {
          content: [
            {
              type: 'text',
              text: `get current document info failed: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
    });
  • Exports the registerGetCurrentDocumentInfoTool function, which registers the 'get_current_document_info' tool on the MCP server with a Chinese description, empty input schema, and the handler function.
    export function registerGetCurrentDocumentInfoTool(server: McpServer) {
      console.error('[DEBUG] Registering get_current_document_info tool');
    
      server.tool('get_current_document_info', '获取 Revit 当前活动视图的详细信息,包括视图类型、名称、比例等属性。', {}, async (args, extra) => {
        console.error('[DEBUG] Tool get_current_document_info called with args:', args);
        try {
          console.error('[DEBUG] Establishing connection to Revit');
          const response = await withRevitConnection(async (revitClient) => {
            console.error('[DEBUG] Sending get_current_document_info command to Revit');
            return await revitClient.sendCommand('get_current_document_info', {});
          });
    
          console.error('[DEBUG] Received response from Revit:', JSON.stringify(response).substring(0, 200) + '...');
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(response, null, 2),
              },
            ],
          };
        } catch (error) {
          console.error('[DEBUG] Error in get_current_document_info:', error);
          return {
            content: [
              {
                type: 'text',
                text: `get current document info failed: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      });
    
      console.error('[DEBUG] get_current_document_info tool registered successfully');
    }
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 this is a read operation ('获取' - get), which implies it's non-destructive, but doesn't mention any behavioral traits like whether it requires specific permissions, what happens if no view is active, response format, or potential errors. For a tool with zero 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 that clearly states what the tool does. It's appropriately sized for a zero-parameter tool, front-loaded with the core purpose, and includes helpful examples of the attributes returned. Every word earns its place with no redundancy or unnecessary elaboration.

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 (zero parameters, no annotations, no output schema), the description is reasonably complete for basic understanding. It explains what information is retrieved and from where. However, without an output schema, the description doesn't detail the return format or structure, and it doesn't address potential edge cases (like what happens if no view is active). For a read-only tool with no parameters, this is adequate but leaves room for improvement.

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 tool has zero parameters (schema coverage 100%), so the baseline score for this dimension is 4. The description appropriately doesn't discuss parameters since none exist, and instead focuses on what information the tool retrieves. No parameter information is needed or expected given the empty input schema.

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: '获取 Revit 当前活动视图的详细信息' (Get detailed information about Revit's current active view). It specifies the verb ('获取' - get) and resource ('当前活动视图' - current active view), and lists example attributes ('视图类型、名称、比例等属性' - view type, name, scale, etc.). However, it doesn't explicitly differentiate from sibling tools like 'get_current_view_info' or 'get_current_view_elements', which reduces clarity about when to use this specific tool.

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. There are several sibling tools that appear related to view information ('get_current_view_info', 'get_current_view_elements'), but the description doesn't explain how this tool differs from them or when one should be preferred over another. No context about prerequisites, timing, or exclusions is provided.

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/ideook/revit-mcp'

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