Skip to main content

File Writer Tool

Usage

Portia offers both open source tools as well as a cloud-hosted library of tools to save you development time. You can dig into the specs of those tools in our open source repo (SDK repo ↗).

You can import our open source tools into your project using from portia.open_source_tools.registry import open_source_tool_registry and load them into an InMemoryToolRegistry object. You can also combine their use with cloud or custom tools as explained in the docs (Add custom tools ↗).

Tool details

Tool ID: file_writer_tool

Tool description: Writes content to a file locally

Args schema:

{
"description": "Schema defining the inputs for the FileWriterTool.",
"properties": {
"filename": {
"description": "The location where the file should be saved",
"title": "Filename",
"type": "string"
},
"content": {
"description": "The content to write to the file",
"title": "Content",
"type": "string"
}
},
"required": [
"filename",
"content"
],
"title": "FileWriterToolSchema",
"type": "object"
}

Output schema:

('str', 'A string indicating where the content was written to')