Conversion tools

Learn how to use Conversion tools with Composio

Overview

SLUG: CONVERSION_TOOLS

Description

Conversion Tools is an online service that offers a fast and easy way to convert documents between different formats, like XML, Excel, PDF, Word, Text, CSV, and others.

Authentication Details

bearer_token
stringRequired

Connecting to Conversion tools

Create an auth config

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

1

Select App

Navigate to [Conversion tools](https://platform.composio.dev/marketplace/Conversion tools).

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 Conversion tools Auth Config”. 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
4conversion_tools_auth_config_id = "ac_YOUR_CONVERSION_TOOLS_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 Conversion tools 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, conversion_tools_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 [Conversion tools toolkit’s playground](https://app.composio.dev/app/Conversion tools)

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=["CONVERSION_TOOLS"])
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: Convert JPG to JSON with AI

Description

Tool to convert jpg to structured json using ai. use after uploading the image or specifying its url.

Action Parameters

file_id
string
file_url
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Convert Excel to CSV

Description

Tool to convert excel files to csv. use when you have an excel file (local upload or url) and need a csv output. use after uploading or providing file url.

Action Parameters

delimiter
stringDefaults to ,
file_id
string
file_url
string
quote_all
boolean
utf8_bom
boolean

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Convert Excel to HTML

Description

Tool to convert an excel file to html. use when you need an html table representation of a .xlsx file via upload or url.

Action Parameters

file_url
string
input
stringRequired
options
object
upload
object

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Convert Markdown to HTML

Description

Tool to convert markdown to html. use after uploading the markdown file or specifying its url to generate html content.

Action Parameters

file_id
string
file_url
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Convert OXPS to PDF

Description

Tool to convert an oxps file to pdf. use when you have an oxps file either uploaded (file id) or via url and need a pdf output. provide only one of `file id` or `url`.

Action Parameters

file_id
string
url
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Convert Website to PDF

Description

Tool to convert a website url to pdf. use when you need a pdf snapshot of a web page; returns a task id to poll for completion.

Action Parameters

filename
string
pages
string
url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Convert Website to PNG

Description

Tool to convert a website url to a png image. use when you need a snapshot of an entire web page or specific viewport.

Action Parameters

conversion
stringDefaults to website_to_png
options
object
url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Convert Word to Text

Description

Tool to convert word documents to plain text. use when you have a .doc or .docx file (binary or url) and need its plain text representation.

Action Parameters

file
string
file_url
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Download File

Description

Tool to download a conversion result file by its id. use after task completion to retrieve the output file.

Action Parameters

file_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Upload File

Description

Tool to upload a file for conversion. use when you have a local file and need a file id for further conversion.

Action Parameters

file
stringRequired
filename
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired