Maintainx

Learn how to use Maintainx with Composio

Overview

SLUG: MAINTAINX

Description

MaintainX is a cloud-based computerized maintenance management system (CMMS) that helps organizations centralize maintenance data, communication, and workflows.

Authentication Details

generic_api_key
stringRequired

Connecting to Maintainx

Create an auth config

Use the dashboard to create an auth config for the Maintainx toolkit. This allows you to connect multiple Maintainx accounts to Composio for agents to use.

1

Select App

Navigate to the Maintainx toolkit page and click “Setup Integration”.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Integration”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4maintainx_auth_config_id = "ac_YOUR_MAINTAINX_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": user_api_key}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Maintainx for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, maintainx_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Maintainx toolkit’s playground

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["MAINTAINX"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Create Work Order

Description

This tool creates a new work order in maintainx. it uses the post /api/v1/workorders endpoint. the tool requires a 'title' for the work order and offers several optional parameters including description, priority, duedate, startdate, userids, teamids, proceduretemplateid, locationid, assetid, and categories.

Action Parameters

asset_id
integer
categories
array
description
string
due_date
string
location_id
integer
priority
string
procedure_template_id
integer
start_date
string
team_ids
array
title
stringRequired
user_ids
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Work Order Comment

Description

This tool creates a new comment on an existing work order in maintainx. it allows users to add comments for documentation, updates, or communication purposes within a specific work order. it requires a workorderid and the text content of the comment to create a new comment on the work order, providing capabilities to update maintenance work order records.

Action Parameters

content
stringRequired
work_order_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Work Request Portal

Description

Creates a new work request portal in maintainx. a work request portal allows users to submit work requests through a dedicated url. the portal can be customized with a title, welcome text, and description placeholder. it can be associated with a specific location and asset, and can be configured to require email contact information.

Action Parameters

asset_id
integer
contact_information
string
description_placeholder
string
email_only
boolean
location_id
integer
send_email_notification
boolean
title
stringRequired
welcome_text
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Find Entity

Description

A tool to search and find specific entities within maintainx by specified fields. this tool allows users to search for different types of entities including work orders, users, and locations.

Action Parameters

entity_type
stringRequired
limit
integer
offset
integer
search_query
stringRequired
sort_by
string
sort_order
string
status
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Assets

Description

This tool allows users to retrieve a list of all assets in their organization.

Action Parameters

cursor
string
custom_field_name
array
expand
array
limit
integerDefaults to 100
location_id
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Categories

Description

This tool retrieves a list of all categories in your maintainx organization. categories are used to organize and classify work orders, assets, and other items in the system. it supports listing the categories with pagination and provides details such as category id, name, description, and timestamps for creation and update.

Action Parameters

cursor
string
limit
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Locations

Description

This tool retrieves a list of all available locations in the organization's maintainx account. the locations can be physical places where assets are located, work is performed, or maintenance is needed.

Action Parameters

cursor
string
limit
integerDefaults to 100

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Teams

Description

This tool retrieves a list of all teams in your maintainx organization.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Work Orders

Description

Action to list work orders from maintainx.

Action Parameters

assets
array
assignees
array
categories
array
cursor
string
expand
array
limit
integer
locations
array
notAssets
array
notCategories
array
notLocations
array
notParts
array
notVendors
array
parts
array
priorities
array
show_upcoming
boolean
sort
string
statuses
array
teams
array
title
string
vendors
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Work Order

Description

This tool allows users to update an existing work order in maintainx by modifying specific attributes without affecting other unchanged fields. it requires the workorder id and at least one of the optional parameters (title, description, or priority) to perform the update.

Action Parameters

description
string
priority
string
title
string
workorder_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Work Order Status

Description

This tool allows users to update the status of a specific work order in maintainx. it is focused specifically on status updates, making it more streamlined than the comprehensive 'update work order' action which allows updating multiple fields.

Action Parameters

status
stringRequired
workorder_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired