Skip to main content
Glama

Sap Sm37 Lookup

sap_sm37_lookup
Read-only

List SAP background jobs from SM37 by job name, user, status, and date range, returning structured details and optional logs without navigating the transaction manually.

Instructions

List background jobs from SM37 (Job Overview). USE THIS instead of sap_transaction('SM37') - faster and returns structured data.

Filters: job name (wildcards like BILLING), username, status (scheduled/released/ready/active/finished/canceled), date range.

Note: status=None keeps SAP defaults (all checked except 'Scheduled'). Pass status=['scheduled'] explicitly to include only scheduled jobs.

When include_log=True and exactly one job matches, the job log is included.

Returns job list with name, status, start time, duration, user, and SAP client (mandant).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "sap_sm37_lookup"
  }
}

Input Schema

NameRequiredDescriptionDefault
statusNoStatus filter list (default: None = all statuses).
sessionNoSession ID (e.g., "s1", "s2"). None uses primary session.
to_dateNoEnd date filter in ISO format (YYYY-MM-DD)
agent_idNoAgent identifier for binding check. Optional.
job_nameNoJob name filter (supports * wildcard, default: *)*
usernameNoUser filter (default: * for all users, None to keep SAP default)*
from_dateNoStart date filter in ISO format (YYYY-MM-DD)
include_logNoFetch job log when exactly one job matches (default: False)
output_fileNoIf provided, write full results to this JSON file

Output Schema

NameRequiredDescriptionDefault
jobsNoList of matching jobs
errorNoError message if success=False
popupNoPresent when a popup dialog is active on screen
job_logNoJob log (only populated when include_log=True and exactly one job matches)
successNoWhether the operation succeeded
job_countNoNumber of jobs returned
retrieved_atYesWhen the data was retrieved
active_windowNoWhich window was operated on (e.g., 'wnd[0]', 'wnd[1]'). If 'wnd[1]' or higher, a modal dialog is open.
jobs_truncatedNoTrue if more jobs match than were returned (the lookup returns a limited number)
filters_appliedNoSummary of filters that were applied

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered. The description adds non-obvious behavior beyond that: status=None preserves SAP defaults (all statuses except 'Scheduled'), and include_log only fires for a single match. It stops short of covering session binding, agent_id checks, or output_file side effects.

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?

Front-loaded with the action and the routing decision, then compact labeled sections for filters, defaults caveat, and return contents. No filler sentences; the filter list doubles as a fast reference without bloating length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With nine optional parameters, an output schema, and rich annotations, the description covers the parts that actually change agent behavior (status defaults, log fetching, wildcard names). Only session/agent_id/output_file mechanics are unaddressed, and those are adequately handled in the schema.

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?

Schema coverage is 100%, giving a baseline of 3, but the description genuinely adds meaning: wildcard syntax ('*BILLING*'), the enumerated status vocabulary, and the crucial correction that status=None means SAP defaults rather than literally all statuses as the schema text implies. session, agent_id, and output_file are left to the schema, which is acceptable.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('List background jobs from SM37') and scopes the content as the Job Overview. It also explicitly distinguishes itself from the sibling sap_transaction('SM37'), so an agent can pick correctly without inspecting schemas.

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

Usage Guidelines5/5

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

'USE THIS instead of sap_transaction('SM37') - faster and returns structured data' gives an explicit alternative plus the reason to prefer it. It further specifies when include_log applies (exactly one match) and warns about the status=None default, covering the main decision points.

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