Skip to main content
Glama

get_current_view_info

Retrieve details about the active view in Revit, including view type, name, and scale, to understand the current working environment.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler logic for the 'get_current_view_info' MCP tool. It handles the tool call by connecting to Revit via withRevitConnection, sending the 'get_current_view_info' command, returning the JSON response as text content, or an error message on failure.
    server.tool('get_current_view_info', '获取 Revit 当前活动视图的详细信息,包括视图类型、名称、比例等属性。', {}, async (args, extra) => {
      console.error('[DEBUG] Tool get_current_view_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_view_info command to Revit');
          return await revitClient.sendCommand('get_current_view_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_view_info:', error);
        return {
          content: [
            {
              type: 'text',
              text: `get current view info failed: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
    });
  • The registration function for the 'get_current_view_info' tool. It calls server.tool() to register the tool with its description, empty schema, and inline handler. This function is dynamically imported and invoked by src/tools/register.ts during server startup.
    export function registerGetCurrentViewInfoTool(server: McpServer) {
      console.error('[DEBUG] Registering get_current_view_info tool');
    
      server.tool('get_current_view_info', '获取 Revit 当前活动视图的详细信息,包括视图类型、名称、比例等属性。', {}, async (args, extra) => {
        console.error('[DEBUG] Tool get_current_view_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_view_info command to Revit');
            return await revitClient.sendCommand('get_current_view_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_view_info:', error);
          return {
            content: [
              {
                type: 'text',
                text: `get current view info failed: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      });
    
      console.error('[DEBUG] get_current_view_info tool registered successfully');
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It describes a read-only operation ('获取' - get) which implies non-destructive behavior, but doesn't disclose any behavioral traits like authentication needs, rate limits, error conditions, or what happens if no view is active. For a tool with zero annotation coverage, this leaves significant gaps in understanding its operational behavior.

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 and provides examples of the information returned. Every word contributes meaning without redundancy. It's appropriately sized for a no-parameter tool and front-loads the core functionality.

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 annotations, no output schema), the description is minimally adequate. It explains what information the tool retrieves but doesn't describe the return format, structure, or possible error scenarios. For a read-only tool with no output schema, more detail about the response would be helpful, though the description meets basic requirements.

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 0 parameters with 100% schema description coverage (empty schema). The description doesn't need to explain parameters since none exist. According to scoring rules, 0 parameters earns a baseline score of 4, as there's no parameter information to add beyond what the schema already provides (which is complete).

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.). It doesn't explicitly differentiate from sibling tools like 'get_current_document_info', but the focus on 'view' vs 'document' provides implicit distinction.

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 '当前活动视图' (current active view), suggesting it should be used when the user needs view-specific details in an active Revit session. However, it provides no explicit guidance on when to use this tool versus alternatives like 'get_current_document_info' (for document-level info) or 'get_current_view_elements' (for elements within the view). No exclusions or prerequisites are mentioned.

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