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§
- Events
Filter - Parsed event-query parameters:
offset,events_limit, optionaltypes[]filter, optionalagent_idfilter.
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
argsparameter 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
concurrencyargument. - parse_
cursor - Parse the
cursorargument. ReturnsNonewhen absent, null, or empty. - parse_
events_ agent_ id - Parse
agent_id. ReturnsNonewhen 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 aVec<String>. ReturnsNonewhen absent or empty. - parse_
list_ limit - Parse the
limitargument for list endpoints (default 20, max 100). - parse_
status_ filter - Parse the
status_filterargument. ReturnsNonewhen absent.