Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MAINFRAME_HOSTNoOverride mainframe.host
MAINFRAME_MODENoREAD | WRITE | TESTREAD
MAINFRAME_DEBUGNo0 | 10
MAINFRAME_CONFIGNoPath to config.yaml./config.yaml
MAINFRAME_USERIDYesRACF userid for this session

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
connectA

Open a TN3270 connection to the configured host. Idempotent.

Does NOT log in; call login(userid) afterwards.

loginA

Log in to TSO as userid. Password is fetched from the OS keychain.

Set the password once via scripts/set_password.py before calling this.

Args: userid: RACF userid.

disconnectA

Close the TN3270 session cleanly.

statusA

Return a one-line status: host, connected flag, userid, mode.

reconnectB

Force a disconnect + reconnect. Re-logs in if a userid was previously set.

force_cleanupA

Force-reset the host-side session for the configured userid.

Use when a prior dirty disconnect (or external session) is holding the userid as "IN USE" and blocking new logons. Steps:

  1. Drive the current TN3270 session through the robust logoff protocol (navigate to READY then LOGOFF).

  2. If still dirty, surface a one-line operator instruction for the Hercules console MODIFY command which always works: /F TSO,USER=<userid>,LOGOFF.

Returns a single-line status that the AI can echo verbatim.

get_screenA

Return the current 3270 screen, row-numbered (24 rows x 80 cols).

find_textB

Return all (row, col) coordinates where the literal pattern appears on the current screen.

Args: pattern: Exact text to search for. Case-sensitive.

get_text_atA

Return text at a specific screen position.

Args: row: 1-based row index (1-24). col: 1-based column index (1-80). length: Number of characters to read.

analyze_screen_fieldsA

Return a per-row inventory of non-blank content on the current screen.

Heuristic only: returns each non-empty stripped line with its row number so the AI can locate input fields by neighboring labels.

identify_screenA

Identify the current screen against known signatures.

Returns a screen_id like TSO_READY, ISPF_PRIMARY, ISPF_DSLIST, ISPF_EDIT, SDSF_HOME, or UNKNOWN.

check_for_errorsA

Scan the current screen for abend codes or error markers. Trips lockout if abend found.

send_enterA

Send the ENTER AID key. Returns the resulting screen.

send_pfC

Send a PF key (1-24). Returns the resulting screen.

Args: number: PF key number (1-24).

send_paB

Send a PA key (1-3). Returns the resulting screen.

Args: number: PA key number (1-3).

send_clearA

Send the CLEAR AID key. Returns the resulting screen.

send_keysA

Type text into the current input field at the cursor position. Does NOT submit.

Use send_enter / send_pf afterwards to submit. Do NOT use for passwords; the login tool fetches them from the OS keychain.

Args: text: Characters to type.

wait_for_textB

Block until pattern appears anywhere on screen or timeout elapses.

Args: pattern: Literal text to wait for (case-insensitive). timeout: Seconds to wait. Default 10.

wait_for_screen_changeB

Block until the screen changes from its last observed state, or timeout elapses.

Args: timeout: Seconds to wait. Default 10.

list_datasetsA

List MVS datasets whose name matches pattern (e.g. ADCDC.*).

Uses ISPF 3.4 or z/OS FTP depending on config.dataset.transport. With the ISPF transport, the TN3270 session must already be logged in.

Args: pattern: Fully-qualified dataset name with wildcards (* matches any qualifier).

list_membersB

List members of a PDS (e.g. ADCDC.SOURCE.COBOL).

Args: pds: PDS dataset name without trailing (*).

read_memberA

Read a PDS member as text.

Args: pds_member: PDS.NAME(MEMBER) form.

get_dataset_infoA

Return DCB attributes (RECFM, LRECL, BLKSIZE, DSORG, volume) for a dataset.

Args: dataset: Fully-qualified dataset name.

check_jobA

Return the current JES state of a job.

States: ON INPUT QUEUE | EXECUTING | ON HOLD QUEUE | ON OUTPUT QUEUE | NOT FOUND | UNKNOWN.

Args: job_id: JES job id (e.g. JOB01234). The literal "last" resolves to the most-recently-submitted id this session.

fetch_sysoutA

Fetch a job's SYSOUT and surface RC + abend if present.

Detects abends inside the returned spool body and trips the abend lockout the same way a screen-side check_for_errors would. The spool is purged after fetch so the JES output queue stays clean.

Args: job_id: JES job id, or "last" for the most recent. ddname: Reserved for future per-DD filtering (requires SDSF; TSO OUTPUT returns the union). Currently informational only.

list_my_jobsA

List jobs owned by the current userid (TSO STATUS with no jobid).

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

B3.4/5.0

Scored across 26 tools

Disambiguation5/5

Each tool targets a distinct action or resource: session management, screen inspection, screen input, dataset retrieval, and job monitoring all have specific tools with clear boundaries. Even similar helpers like find_text and wait_for_text are differentiated by intent (scan vs wait), preventing confusion.

Naming Consistency4/5

The majority of tool names follow a consistent snake_case verb-first pattern (list_datasets, get_screen, check_job). Minor deviations like 'status' (a noun rather than get_status) and 'reconnect' (no underscore) are acceptable and do not obscure meaning.

Tool Count3/5

26 tools is slightly above the typical comfortable range, but the complexity of mainframe interaction justifies a large set covering session control, screen access, and specific operations. Still, some tools like send_clear and send_enter could potentially be consolidated, making it feel a bit heavy.

Completeness3/5

The tool set covers read-oriented workflows well (listing members, reading datasets, checking jobs, fetching SYSOUT), but lacks write operations such as dataset creation/update, job submission, or file upload. This leaves notable gaps for any workflow requiring modifications rather than just inspection.

Maintenance

ActivityMaintained
ResponsivenessNo issues