Skip to main content
Glama

get_views

Retrieve all views from a Revit model to access architectural plans, sections, and elevations for project analysis and documentation.

Instructions

获取 Revit 模型中的所有视图

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP server request handler for CallToolRequestSchema. Dynamically converts tool name 'get_views' to 'getViews' and invokes the corresponding method on RevitService instance.
      this.server.setRequestHandler(
        CallToolRequestSchema,
        async (request) => {
          // 获取工具名称
          const toolName = request.params.name;
    
          // 将工具名称转换为 camelCase 方法名
          const methodName = toolName.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
    
          // 检查 RevitService 是否有对应的方法
          if (typeof (this.revitService as any)[methodName] !== 'function') {
            throw new McpError(
              ErrorCode.MethodNotFound,
              `未知工具: ${toolName}`
            );
          }
    
          try {
            // 动态调用对应的方法
            const result = await (this.revitService as any)[methodName](request.params.arguments || {});
            //const result = '';
            return {
              content: [{
                type: "text",
                text: JSON.stringify(result, null, 2)
              }]
            };
          } catch (error) {
            return {
              content: [{
                type: "text",
                text: `Revit API 错误: ${error instanceof Error ? error.message : String(error)}`
              }],
              isError: true,
            }
          }
        }
      );
    }
  • The specific getViews() method on RevitService class, executed as the tool handler logic for 'get_views'. Delegates the call to the underlying RevitSocketClient.
    /**
     * 获取所有视图
     */
    async getViews(): Promise<any[]> {
      try {
        return await this.client.getViews();
      } catch (error) {
        console.error('[RevitService] 获取视图失败:', error);
        throw error; // 不使用模拟数据,直接抛出错误
      }
    }
  • The RevitSocketClient.getViews() helper method that sends the 'get_views' command with empty arguments to the Revit socket server and returns the response.
     */
    public async getViews(): Promise<any[]> {
      const response = await this.sendRequest<any[]>('get_views', {});
      return response;
    }
  • src/index.ts:167-174 (registration)
    The tool registration entry for 'get_views' in the ListToolsRequestSchema response, including name, description, and input schema.
    }, {
      name: "get_views",
      description: "获取 Revit 模型中的所有视图",
      inputSchema: {
        type: "object",
        properties: {}
      }
    }, {
  • The input schema definition for the 'get_views' tool, specifying an empty object with no properties.
    inputSchema: {
      type: "object",
      properties: {}
    }
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 what the tool does but doesn't describe behavioral traits such as whether it requires authentication, has rate limits, returns a list or structured data, or handles errors. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 with zero waste. It's appropriately sized and front-loaded, making it easy to understand at a glance without 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 has no parameters, no annotations, and no output schema, the description is minimally complete for a simple retrieval operation. However, it lacks details on output format (e.g., list of view names, structured data) and behavioral context, which could be important for an AI agent to use it correctly. It's adequate 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 doesn't add parameter details beyond the schema, but since there are no parameters, a baseline score of 4 is appropriate as it doesn't need to compensate for any gaps.

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/retrieve) and the resource 'Revit 模型中的所有视图' (all views in a Revit model), providing a specific purpose. However, it doesn't explicitly differentiate from sibling tools like 'get_elements' or 'get_levels', which might retrieve different types of Revit model components.

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., needing an open Revit model), exclusions, or comparisons to sibling tools like 'get_elements' (which might include views as a subset). Usage is implied by the purpose but not explicitly stated.

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/PiggyAndrew/revit_mcp'

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