Skip to main content

Module params

Module params 

Source
Expand description

Shared parameter parsing for workflow tool consumers.

Both Loom’s tool-workflow and Luft’s luft-mcp expose tools that accept the same JSON arguments (concurrency, offset, events_limit, types, agent_id). This module provides a single source of truth for parsing and validating those parameters, eliminating ~140 lines of duplication.

Structs§

EventsFilter
Parsed event-query parameters: offset, events_limit, optional types[] filter, optional agent_id filter.

Constants§

DEFAULT_EVENTS_LIMIT
DEFAULT_LIST_LIMIT
Default page size for list endpoints.
MAX_CONCURRENCY
MAX_EVENTS_LIMIT
MAX_LIST_LIMIT
Maximum page size for list endpoints.
MIN_CONCURRENCY
STATUS_FILTERS
Valid status filter values (case-insensitive).

Functions§

extract_user_args
Extract the optional args parameter from a JSON args object.
inject_args_globals
Prepend _G._args = <lua_expr> to the Lua source when user args are present.
paginate
Apply offset/limit pagination to a slice and compute next_offset.
paginate_cursor
Cursor-based pagination for list endpoints.
parse_concurrency
Parse the optional concurrency argument.
parse_cursor
Parse the cursor argument. Returns None when absent, null, or empty.
parse_events_agent_id
Parse agent_id. Returns None when absent or null.
parse_events_limit
Parse events_limit (default 50, clamped to [1, 500]).
parse_events_offset
Parse offset (default 0).
parse_events_types
Parse types[] into a Vec<String>. Returns None when absent or empty.
parse_list_limit
Parse the limit argument for list endpoints (default 20, max 100).
parse_status_filter
Parse the status_filter argument. Returns None when absent.