Skip to main content
Glama
MCP SAP GUI Server

MCP SAP GUI Server

by kts982

Sap Set Focus

sap_set_focus

Sets focus to a SAP GUI screen element by ID before sending keys or triggering field actions like F4 search help, ensuring required controls are active.

Instructions

Set focus to any screen element by its ID.

Some SAP actions require focus on a specific element before they work (e.g., F4 search help on a field). Use this to set focus before sending keys with sap_send_key.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "element_id": "<element_id>"
    },
    "name": "sap_set_focus"
  }
}

Input Schema

NameRequiredDescriptionDefault
element_idYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false and destructiveHint=false, so the agent knows this mutates UI state without destroying data. The description usefully adds that the effect is a prerequisite state change for later key sends. It says nothing about failure modes (invalid or stale element_id) or whether focus persists across an action, which is the remaining behavioral 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?

Three short lines: capability first, then why and when, then the paired tool. No filler, and the ordering front-loads what the tool does.

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?

An output schema exists, so return values need not be explained, and the tool is simple at one required parameter. What is missing is operational context an agent needs: the source of element IDs and what happens when the ID does not resolve. Adequate but with a clear gap.

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%: element_id is a bare string with no documented format. The description only repeats 'by its ID' and never says how to obtain a valid ID, even though the sibling sap_get_screen_elements exists for that purpose. It therefore compensates very little for the coverage gap on the single parameter.

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?

States a specific verb and resource ('Set focus to any screen element') with the keying mechanism ('by its ID'), which separates it from nearby mutators like sap_set_field or sap_press_button. It does not explicitly contrast with the closest relative, sap_set_current_cell, so the sibling boundary is inferred rather than stated.

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

Usage Guidelines4/5

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

Gives a concrete trigger ('Some SAP actions require focus on a specific element before they work') with an example (F4 search help) and a sequencing rule ('use this before sending keys with sap_send_key'). It never states when focus is unnecessary or should be avoided, so the negative case is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.