Skip to main content
Glama
nonead

nUR MCP Server

by nonead

get_program_state

Retrieve the program execution status of a Universal Robots collaborative robot by specifying its IP address to monitor operational state.

Instructions

获取指定IP机器人的程序执行状态 IP:机器人地址

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipYes

Implementation Reference

  • The handler function for the 'get_program_state' MCP tool. It checks the robot connection, queries the dashboard for the loaded program name, program state, whether the program is saved, and if it's running, then constructs a status message.
    @mcp.tool()
    def get_program_state(ip: str):
        """获取指定IP机器人的程序执行状态
            IP:机器人地址"""
        try:
            if '连接失败' in link_check(ip):
                return return_msg(f"与机器人的连接已断开。")
    
            robot_list[ip].robotConnector.DashboardClient.ur_get_loaded_program()
            prog_name = robot_list[ip].robotConnector.DashboardClient.last_respond
            robot_list[ip].robotConnector.DashboardClient.ur_programState()
            prog_state = robot_list[ip].robotConnector.DashboardClient.last_respond
            robot_list[ip].robotConnector.DashboardClient.ur_isProgramSaved()
            flg = robot_list[ip].robotConnector.DashboardClient.last_respond
            robot_list[ip].robotConnector.DashboardClient.ur_running()
            running = robot_list[ip].robotConnector.DashboardClient.last_respond
    
            prog_saved = ''
            prog_running = ''
            if flg.startswith("false"):
                prog_saved = '程序未保存,请及时保存或备份正在编辑的程序。'
            if running == 'Program running: true':
                prog_running = '机械臂正在动作。'
            logger.info(
                f"IP为{ip}的优傲机器人当前加载的程序是:{prog_name},程序的执行状态是:{prog_state}。{prog_saved}。{prog_running}")
            return return_msg(
                f"IP为{ip}的优傲机器人当前加载的程序是:{prog_name},程序的执行状态是:{prog_state}。{prog_saved}。{prog_running}")
        except Exception as e:
            logger.error(f"程序的执行状态获取失败: {str(e)}")
            return return_msg(f"程序的执行状态获取失败: {str(e)}")
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 states what the tool does but doesn't disclose behavioral traits like whether this is a read-only operation, what permissions are required, whether it returns real-time or cached data, error conditions, or response format. For a tool querying robot state with no annotation coverage, this is a significant gap.

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 extremely concise with just two lines that directly state the purpose and parameter meaning. Every word earns its place with zero redundancy. The information is front-loaded with the core purpose stated first. This is model efficiency for a simple tool.

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 no annotations, no output schema, and 0% schema description coverage, the description is incomplete. It covers the basic purpose and parameter identity but lacks crucial context about what 'program execution state' entails, return format, error handling, or behavioral characteristics. For a tool in a robotics context with many sibling alternatives, more completeness is needed.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions the 'ip' parameter and clarifies it's a '机器人地址' (robot address), which adds some semantic meaning beyond the schema's bare 'Ip' title. However, it doesn't specify format (IPv4, hostname), validation rules, or examples. With only basic clarification for a single parameter, it partially compensates but not fully.

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) and the resource '程序执行状态' (program execution state) for a specified IP robot. It distinguishes from siblings like get_robot_mode or get_programs by focusing specifically on program execution status rather than robot operational mode or program listings. However, it doesn't explicitly contrast with all possible similar tools.

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. With many sibling tools like get_robot_mode, get_programs, and get_actual_tcp_pose, there's no indication of when program state is needed versus other robot status queries. No prerequisites, exclusions, or comparative context is 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/nonead/nUR-MCP-SERVER'

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