Skip to content

API Reference parrot_tools.gigsmart.toolkit

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.gigsmart.toolkit

View source

GigSmartToolkit — AbstractToolkit exposing GigSmart API surfaces as LLM tools.

Provides 23 async tool methods organised into 7 surfaces:

  • Organizations (2): list_organizations, get_organization
  • Locations (3): list_locations, place_autocomplete, add_organization_location
  • Positions (3): list_positions, get_position, add_organization_position
  • Gigs/Shifts (4): list_gigs, get_gig, post_shift, transition_gig
  • Engagements (4): list_engagements, get_engagement, transition_engagement, list_engagement_states
  • Timesheets (4): list_timesheets, get_timesheet, approve_timesheet, remove_timesheet_dispute
  • Messages (1): add_conversation_message
  • Utilities (2): search_gigs, get_gig_summary

Write mutations are gated via confirming_tools (HITL confirmation required). Large result sets (>10 items) optionally spill to WorkingMemory DataFrames via the optional WorkingMemoryToolkit composition.

Alias ADD_ORGANIZATION_LOCATION

Re-exported from parrot_tools.interfaces.gigsmart.queries.locations.ADD_ORGANIZATION_LOCATION.

Alias ADD_ORGANIZATION_POSITION

Re-exported from parrot_tools.interfaces.gigsmart.queries.positions.ADD_ORGANIZATION_POSITION.

Alias ADD_USER_MESSAGE

Re-exported from parrot_tools.interfaces.gigsmart.queries.messages.ADD_USER_MESSAGE.

Alias APPROVE_ENGAGEMENT_TIMESHEET

Re-exported from parrot_tools.interfaces.gigsmart.queries.timesheets.APPROVE_ENGAGEMENT_TIMESHEET.

Alias AbstractToolkit

Re-exported from parrot_tools.toolkit.AbstractToolkit.

Alias AddConversationMessageInput

Re-exported from parrot_tools.gigsmart.schemas.AddConversationMessageInput.

Alias AddOrganizationLocationInput

Re-exported from parrot_tools.gigsmart.schemas.AddOrganizationLocationInput.

Alias AddOrganizationPositionInput

Re-exported from parrot_tools.gigsmart.schemas.AddOrganizationPositionInput.

Alias ApproveTimesheetInput

Re-exported from parrot_tools.gigsmart.schemas.ApproveTimesheetInput.

Alias GET_ENGAGEMENT

Re-exported from parrot_tools.interfaces.gigsmart.queries.engagements.GET_ENGAGEMENT.

Alias GET_GIG

Re-exported from parrot_tools.interfaces.gigsmart.queries.gigs.GET_GIG.

Alias GET_GIG_SUMMARY

Re-exported from parrot_tools.interfaces.gigsmart.queries.gigs.GET_GIG_SUMMARY.

Alias GET_POSITION

Re-exported from parrot_tools.interfaces.gigsmart.queries.positions.GET_POSITION.

Alias GET_TIMESHEET

Re-exported from parrot_tools.interfaces.gigsmart.queries.timesheets.GET_TIMESHEET.

Alias GetEngagementInput

Re-exported from parrot_tools.gigsmart.schemas.GetEngagementInput.

Alias GetGigInput

Re-exported from parrot_tools.gigsmart.schemas.GetGigInput.

Alias GetGigSummaryInput

Re-exported from parrot_tools.gigsmart.schemas.GetGigSummaryInput.

Alias GetOrganizationInput

Re-exported from parrot_tools.gigsmart.schemas.GetOrganizationInput.

Alias GetPositionInput

Re-exported from parrot_tools.gigsmart.schemas.GetPositionInput.

Alias GetTimesheetInput

Re-exported from parrot_tools.gigsmart.schemas.GetTimesheetInput.

Alias GigSmartClient

Re-exported from parrot_tools.interfaces.gigsmart.client.GigSmartClient.

Alias GigSmartConfig

Re-exported from parrot_tools.interfaces.gigsmart.config.GigSmartConfig.

Class GigSmartToolkit

LLM toolkit for interacting with the GigSmart staffing platform API.

Exposes 23 async methods as tools. Write mutations are gated via confirming_tools for human-in-the-loop safety. Large list results (>10 items) optionally spill to WorkingMemory DataFrames when a WorkingMemoryToolkit instance is provided.

Example::

config = GigSmartConfig.from_env()
toolkit = GigSmartToolkit(config=config)
tools = toolkit.get_tools()
Parameter Type Default Description
config GigSmartConfig GigSmartConfig carrying client credentials and endpoint settings.
wm Any | None None Optional WorkingMemoryToolkit for DataFrame spilling.
**kwargs Any {} Additional kwargs forwarded to AbstractToolkit.init.

Attributes:

Attribute Type Description
name str
description str
tool_prefix str
confirming_tools frozenset

Method GigSmartToolkit.start

Open the underlying GigSmartClient session.

start() -> None

Method GigSmartToolkit.stop

Close the underlying GigSmartClient session.

stop() -> None

Method GigSmartToolkit.cleanup

Alias for stop() — closes the client session.

cleanup() -> None

Method GigSmartToolkit.list_organizations

List organizations accessible to the authenticated requester.

Returns a list of organization summaries. Use pagination cursors to retrieve additional pages of results.

list_organizations(first: int = 25, after: str | None = None, filter_name: str | None = None) -> list[dict]

Parameter Type Default Description
first int 25 Maximum number of organizations to return (1-100).
after str | None None Pagination cursor from a previous response.
filter_name str | None None Optional name filter substring.

Returns: list[dict] — List of organization dicts with id, name, and related metadata.

Method GigSmartToolkit.get_organization

Get details for a specific organization by ID.

get_organization(organization_id: str) -> dict

Parameter Type Default Description
organization_id str Organization ID (e.g. org_xxx).

Returns: dict — Organization dict with id, name, and related metadata.

Method GigSmartToolkit.list_locations

List locations for an organization.

Returns a list of location summaries including ID, name, state, and GPS coordinates. Use pagination cursors to retrieve additional pages.

list_locations(organization_id: str, first: int = 25, after: str | None = None) -> list[dict]

Parameter Type Default Description
organization_id str Organization ID.
first int 25 Maximum number of locations to return (1-100).
after str | None None Pagination cursor from a previous response.

Returns: list[dict] — List of location dicts.

Method GigSmartToolkit.place_autocomplete

Search for address suggestions using GigSmart place autocomplete.

Use this to resolve human-readable addresses into placeIds before calling add_organization_location.

place_autocomplete(search_text: str) -> list[dict]

Parameter Type Default Description
search_text str Address or location search string.

Returns: list[dict] — List of place suggestion dicts with label, placeId, and placeProvider.

Method GigSmartToolkit.add_organization_location

Create a new location for an organization.

Use place_autocomplete first to resolve the address into a placeId. This is a write mutation and requires HITL confirmation.

add_organization_location(organization_id: str, name: str, place_id: str | None = None, address: str | None = None, arrival_instructions: str | None = None, location_instructions: str | None = None) -> dict

Parameter Type Default Description
organization_id str Target organization ID.
name str Location name (1-120 characters).
place_id str | None None Geocoder place ID (preferred over raw address).
address str | None None Raw address string (used when place_id is unavailable).
arrival_instructions str | None None Instructions for workers arriving at this location.
location_instructions str | None None On-site location instructions.

Returns: dict — The created OrganizationLocation dict with id, name, and state.

Method GigSmartToolkit.list_positions

List positions for an organization.

Returns position templates including ID, name, description, and pay rate.

list_positions(organization_id: str, first: int = 25, after: str | None = None) -> list[dict]

Parameter Type Default Description
organization_id str Organization ID.
first int 25 Maximum number of positions to return (1-100).
after str | None None Pagination cursor from a previous response.

Returns: list[dict] — List of position dicts.

Method GigSmartToolkit.get_position

Get details for a specific position by ID.

get_position(position_id: str) -> dict

Parameter Type Default Description
position_id str Position ID (e.g. pos_xxx).

Returns: dict — Position dict with id, name, description, and payRate.

Method GigSmartToolkit.add_organization_position

Create a new position for an organization.

This is a write mutation and requires HITL confirmation.

add_organization_position(organization_id: str, name: str, category_id: str | None = None, description: str | None = None, pay_rate: str | None = None, pay_schedule: str | None = None) -> dict

Parameter Type Default Description
organization_id str Target organization ID.
name str Position name.
category_id str | None None GigSmart gig category ID (optional).
description str | None None Position description (optional).
pay_rate str | None None Pay rate as ISO-4217 string (e.g. '20.00').
pay_schedule str | None None FIXED, HOURLY, or INFO_REQUIRED.

Returns: dict — The created OrganizationPosition dict.

Method GigSmartToolkit.list_gigs

List gigs (shifts) for an organization with optional state filtering.

Returns a list of gig summaries including ID, name, dates, state, and pay rate. Use state_filter with values like ACTIVE, UPCOMING, COMPLETED.

list_gigs(organization_id: str, first: int = 25, after: str | None = None, state_filter: str | None = None) -> list[dict]

Parameter Type Default Description
organization_id str Organization ID.
first int 25 Maximum number of gigs to return (1-100).
after str | None None Pagination cursor from a previous response.
state_filter str | None None Optional gig state filter (e.g. ACTIVE, UPCOMING).

Returns: list[dict] — List of gig dicts.

Method GigSmartToolkit.get_gig

Get full details for a specific gig by ID.

get_gig(gig_id: str) -> dict

Parameter Type Default Description
gig_id str Gig ID (e.g. gig_xxx).

Returns: dict — Gig dict with id, name, dates, state, slotsAvailable, and payRate.

Method GigSmartToolkit.post_shift

Post a new shift (gig) for an organization.

This is a write mutation and requires HITL confirmation. The shift will be created in DRAFT state; use transition_gig(action=PUBLISH) to make it visible to workers.

post_shift(organization_id: str, position_id: str, location_id: str, starts_at: datetime, ends_at: datetime, slots_available: int = 1, pay_rate: str | None = None, description: str | None = None) -> dict

Parameter Type Default Description
organization_id str Organization that will host the shift.
position_id str Organization position ID for the shift type.
location_id str Organization location ID where the shift takes place.
starts_at datetime Shift start time (ISO-8601 with timezone).
ends_at datetime Shift end time (ISO-8601 with timezone).
slots_available int 1 Number of worker slots to fill (minimum 1).
pay_rate str | None None Pay rate override as ISO-4217 string (e.g. '22.50').
description str | None None Optional shift-specific instructions (max 5000 chars).

Returns: dict — The created shift dict with id, name, dates, and currentState.

Method GigSmartToolkit.transition_gig

Transition a gig to a new state.

This is a write mutation and requires HITL confirmation. Valid actions: CANCEL, CLOSE, MARK_AS_COMPLETE, PUBLISH.

transition_gig(gig_id: str, action: str) -> dict

Parameter Type Default Description
gig_id str Gig ID to transition (e.g. gig_xxx).
action str Transition action — CANCEL, CLOSE, MARK_AS_COMPLETE, or PUBLISH.

Returns: dict — The updated gig dict with id, name, and currentState.

Method GigSmartToolkit.list_engagements

List engagements for a gig with optional state filtering.

Engagements link workers to gigs. Each engagement tracks one worker's lifecycle from application through payment.

list_engagements(gig_id: str, first: int = 25, after: str | None = None, state_filter: str | None = None) -> list[dict]

Parameter Type Default Description
gig_id str Gig ID to list engagements for.
first int 25 Maximum number of engagements to return (1-100).
after str | None None Pagination cursor from a previous response.
state_filter str | None None Filter by engagement state (e.g. SCHEDULED, HIRED).

Returns: list[dict] — List of engagement dicts.

Method GigSmartToolkit.get_engagement

Get full details for a specific engagement by ID.

get_engagement(engagement_id: str) -> dict

Parameter Type Default Description
engagement_id str Engagement ID (e.g. eng_xxx).

Returns: dict — Engagement dict with id, gigId, workerDisplayName, currentState, etc.

Method GigSmartToolkit.transition_engagement

Transition an engagement to a new state.

This is the SINGLE mutation for ALL engagement state transitions. This is a write mutation and requires HITL confirmation.

Key actions: HIRE, ACCEPT, START, END, CANCEL, OFFER, PAUSE, RESUME, APPROVE_TIMESHEET, BID, DENY_APPLICATION, RESCIND.

transition_engagement(engagement_id: str, action: str, cancel_conflicting: bool | None = None) -> dict

Parameter Type Default Description
engagement_id str Engagement ID to transition.
action str EngagementStateAction value (e.g. HIRE, CANCEL, END).
cancel_conflicting bool | None None Whether to cancel conflicting active engagements.

Returns: dict — Updated engagement dict with id and currentState.

Method GigSmartToolkit.list_engagement_states

List the full state history for an engagement.

Returns a chronological list of all state transitions the engagement has gone through.

Note: Returns only the first page of results. For engagements with many state transitions, not all states may be returned.

list_engagement_states(engagement_id: str) -> list[dict]

Parameter Type Default Description
engagement_id str Engagement ID to inspect.

Returns: list[dict] — List of state transition dicts with name and transitionedAt.

Method GigSmartToolkit.list_timesheets

List timesheets for an engagement.

Timesheets record hours worked and payment details. An engagement may have multiple timesheet variants (ADMIN, FINAL, REQUESTER, WORKER, etc.).

Note: Returns only the first page of results. For engagements with many timesheets, not all timesheets may be returned.

list_timesheets(engagement_id: str) -> list[dict]

Parameter Type Default Description
engagement_id str Engagement ID.

Returns: list[dict] — List of timesheet dicts with id, isApproved, variant, and paymentStyle.

Method GigSmartToolkit.get_timesheet

Get full details for a specific timesheet by ID.

get_timesheet(timesheet_id: str) -> dict

Parameter Type Default Description
timesheet_id str Timesheet ID (e.g. engts_xxx).

Returns: dict — Timesheet dict with id, engagementId, isApproved, variant, and paymentStyle.

Method GigSmartToolkit.approve_timesheet

Approve a worker's timesheet.

This is a write mutation and requires HITL confirmation. Once approved, the timesheet proceeds to payment processing.

approve_timesheet(timesheet_id: str, mutation_lock: str | None = None) -> dict

Parameter Type Default Description
timesheet_id str Timesheet ID to approve.
mutation_lock str | None None Optional optimistic concurrency lock token.

Returns: dict — Updated timesheet dict with id and isApproved.

Method GigSmartToolkit.remove_timesheet_dispute

Reject a timesheet and send it back to the worker for resubmission.

This is a write mutation and requires HITL confirmation. The worker will be notified to review and resubmit their timesheet. This does NOT delete the timesheet record.

remove_timesheet_dispute(timesheet_id: str) -> dict

Parameter Type Default Description
timesheet_id str Timesheet ID to reject/send back.

Returns: dict — Updated timesheet dict.

Method GigSmartToolkit.add_conversation_message

Send a message to a worker via the engagement conversation thread.

This is a write mutation and requires HITL confirmation.

add_conversation_message(engagement_id: str, body: str) -> dict

Parameter Type Default Description
engagement_id str Engagement ID for the conversation thread.
body str Message body text to send.

Returns: dict — The created message dict with id, body, and insertedAt.

Method GigSmartToolkit.search_gigs

Search for gigs matching a text query and optional location filter.

Returns gig summaries that match the given search criteria.

search_gigs(query: str, location: str | None = None, radius_miles: float | None = None, first: int = 25) -> list[dict]

Parameter Type Default Description
query str Search query text.
location str | None None Optional location name or address to filter by proximity.
radius_miles float | None None Optional search radius in miles (requires location).
first int 25 Maximum number of results to return (1-100).

Returns: list[dict] — List of matching gig dicts.

Method GigSmartToolkit.get_gig_summary

Get an enriched summary of a gig including engagement counts and timesheet status.

Combines the gig's core data with a count of engagements by state, making it useful for a quick operational overview of a shift.

get_gig_summary(gig_id: str) -> dict

Parameter Type Default Description
gig_id str Gig ID (e.g. gig_xxx).

Returns: dict — Enriched gig dict with id, name, dates, state, and engagement summary.

Alias LIST_ENGAGEMENTS

Re-exported from parrot_tools.interfaces.gigsmart.queries.engagements.LIST_ENGAGEMENTS.

Alias LIST_ENGAGEMENT_STATES

Re-exported from parrot_tools.interfaces.gigsmart.queries.engagements.LIST_ENGAGEMENT_STATES.

Alias LIST_GIGS

Re-exported from parrot_tools.interfaces.gigsmart.queries.gigs.LIST_GIGS.

Alias LIST_LOCATIONS

Re-exported from parrot_tools.interfaces.gigsmart.queries.locations.LIST_LOCATIONS.

Alias LIST_POSITIONS

Re-exported from parrot_tools.interfaces.gigsmart.queries.positions.LIST_POSITIONS.

Alias LIST_TIMESHEETS

Re-exported from parrot_tools.interfaces.gigsmart.queries.timesheets.LIST_TIMESHEETS.

Alias ListEngagementStatesInput

Re-exported from parrot_tools.gigsmart.schemas.ListEngagementStatesInput.

Alias ListEngagementsInput

Re-exported from parrot_tools.gigsmart.schemas.ListEngagementsInput.

Alias ListGigsInput

Re-exported from parrot_tools.gigsmart.schemas.ListGigsInput.

Alias ListLocationsInput

Re-exported from parrot_tools.gigsmart.schemas.ListLocationsInput.

Alias ListOrganizationsInput

Re-exported from parrot_tools.gigsmart.schemas.ListOrganizationsInput.

Alias ListPositionsInput

Re-exported from parrot_tools.gigsmart.schemas.ListPositionsInput.

Alias ListTimesheetsInput

Re-exported from parrot_tools.gigsmart.schemas.ListTimesheetsInput.

Alias PLACE_AUTOCOMPLETE

Re-exported from parrot_tools.interfaces.gigsmart.queries.locations.PLACE_AUTOCOMPLETE.

Alias POST_SHIFT

Re-exported from parrot_tools.interfaces.gigsmart.queries.gigs.POST_SHIFT.

Alias PlaceAutocompleteInput

Re-exported from parrot_tools.gigsmart.schemas.PlaceAutocompleteInput.

Alias PostShiftInput

Re-exported from parrot_tools.gigsmart.schemas.PostShiftInput.

Alias REMOVE_ENGAGEMENT_TIMESHEET

Re-exported from parrot_tools.interfaces.gigsmart.queries.timesheets.REMOVE_ENGAGEMENT_TIMESHEET.

Alias RemoveTimesheetDisputeInput

Re-exported from parrot_tools.gigsmart.schemas.RemoveTimesheetDisputeInput.

Alias SEARCH_GIGS

Re-exported from parrot_tools.interfaces.gigsmart.queries.gigs.SEARCH_GIGS.

Alias SearchGigsInput

Re-exported from parrot_tools.gigsmart.schemas.SearchGigsInput.

Alias TRANSITION_ENGAGEMENT

Re-exported from parrot_tools.interfaces.gigsmart.queries.engagements.TRANSITION_ENGAGEMENT.

Alias TRANSITION_GIG

Re-exported from parrot_tools.interfaces.gigsmart.queries.gigs.TRANSITION_GIG.

Alias TransitionEngagementInput

Re-exported from parrot_tools.gigsmart.schemas.TransitionEngagementInput.

Alias TransitionGigInput

Re-exported from parrot_tools.gigsmart.schemas.TransitionGigInput.

Alias tool_schema

Re-exported from parrot_tools.decorators.tool_schema.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally