Skip to content
  • Auto
  • Light
  • Dark
DiscordForumGitHubSign up
View as Markdown
Copy Markdown

Open in Claude
Open in ChatGPT

Tools

Delete Tool
tools.delete(strtool_id) -> object
delete/v1/tools/{tool_id}
Retrieve Tool
tools.retrieve(strtool_id) -> Tool
get/v1/tools/{tool_id}
Modify Tool
tools.modify(strtool_id, ToolModifyParams**kwargs) -> Tool
patch/v1/tools/{tool_id}
List Tools
tools.list(ToolListParams**kwargs) -> SyncArrayPage[Tool]
get/v1/tools/
Create Tool
tools.create(ToolCreateParams**kwargs) -> Tool
post/v1/tools/
Upsert Tool
tools.upsert(ToolUpsertParams**kwargs) -> Tool
put/v1/tools/
Upsert Base Tools
tools.upsert_base_tools() -> ToolUpsertBaseToolsResponse
post/v1/tools/add-base-tools
ModelsExpand Collapse
class NpmRequirement:
name: str

Name of the npm package.

minLength1
version: Optional[str]

Optional version of the package, following semantic versioning.

class PipRequirement:
name: str

Name of the pip package.

minLength1
version: Optional[str]

Optional version of the package, following semantic versioning.

class Tool:

Representation of a tool, which is a function that can be called by the agent.

id: str

The human-friendly ID of the Tool

args_json_schema: Optional[Dict[str, object]]

The args JSON schema of the function.

created_by_id: Optional[str]

The id of the user that made this Tool.

default_requires_approval: Optional[bool]

Default value for whether or not executing this tool requires approval.

description: Optional[str]

The description of the tool.

enable_parallel_execution: Optional[bool]

If set to True, then this tool will potentially be executed concurrently with other tools. Default False.

json_schema: Optional[Dict[str, object]]

The JSON schema of the function.

last_updated_by_id: Optional[str]

The id of the user that made this Tool.

metadata: Optional[Dict[str, object]]

A dictionary of additional metadata for the tool.

name: Optional[str]

The name of the function.

npm_requirements: Optional[List[NpmRequirement]]

Optional list of npm packages required by this tool.

name: str

Name of the npm package.

minLength1
version: Optional[str]

Optional version of the package, following semantic versioning.

pip_requirements: Optional[List[PipRequirement]]

Optional list of pip packages required by this tool.

name: str

Name of the pip package.

minLength1
version: Optional[str]

Optional version of the package, following semantic versioning.

return_char_limit: Optional[int]

The maximum number of characters in the response.

maximum1000000
minimum1
source_code: Optional[str]

The source code of the function.

source_type: Optional[str]

The type of the source code.

tags: Optional[List[str]]

Metadata tags.

tool_type: Optional[ToolType]

The type of the tool.

Accepts one of the following:
"custom"
"letta_core"
"letta_memory_core"
"letta_multi_agent_core"
"letta_sleeptime_core"
"letta_voice_sleeptime_core"
"letta_builtin"
"letta_files_core"
"external_langchain"
"external_composio"
"external_mcp"
class ToolCreate:
source_code: str

The source code of the function.

args_json_schema: Optional[Dict[str, object]]

The args JSON schema of the function.

default_requires_approval: Optional[bool]

Whether or not to require approval before executing this tool.

description: Optional[str]

The description of the tool.

enable_parallel_execution: Optional[bool]

If set to True, then this tool will potentially be executed concurrently with other tools. Default False.

json_schema: Optional[Dict[str, object]]

The JSON schema of the function (auto-generated from source_code if not provided)

npm_requirements: Optional[List[NpmRequirement]]

Optional list of npm packages required by this tool.

name: str

Name of the npm package.

minLength1
version: Optional[str]

Optional version of the package, following semantic versioning.

pip_requirements: Optional[List[PipRequirement]]

Optional list of pip packages required by this tool.

name: str

Name of the pip package.

minLength1
version: Optional[str]

Optional version of the package, following semantic versioning.

return_char_limit: Optional[int]

The maximum number of characters in the response.

maximum1000000
minimum1
source_type: Optional[str]

The source type of the function.

tags: Optional[List[str]]

Metadata tags.

class ToolReturnMessage:

A message representing the return value of a tool call (generated by Letta executing the requested tool).

Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message tool_return (str): The return value of the tool (deprecated, use tool_returns) status (Literal["success", "error"]): The status of the tool call (deprecated, use tool_returns) tool_call_id (str): A unique identifier for the tool call that generated this message (deprecated, use tool_returns) stdout (Optional[List(str)]): Captured stdout (e.g. prints, logs) from the tool invocation (deprecated, use tool_returns) stderr (Optional[List(str)]): Captured stderr from the tool invocation (deprecated, use tool_returns) tool_returns (Optional[List[ToolReturn]]): List of tool returns for multi-tool support

id: str
date: datetime
Deprecatedstatus: Literal["success", "error"]
Accepts one of the following:
"success"
"error"
Deprecatedtool_call_id: str
Deprecatedtool_return: str
is_err: Optional[bool]
message_type: Optional[Literal["tool_return_message"]]

The type of the message.

Accepts one of the following:
"tool_return_message"
name: Optional[str]
otid: Optional[str]
run_id: Optional[str]
sender_id: Optional[str]
seq_id: Optional[int]
Deprecatedstderr: Optional[List[str]]
Deprecatedstdout: Optional[List[str]]
step_id: Optional[str]
tool_returns: Optional[List[ToolReturn]]
status: Literal["success", "error"]
Accepts one of the following:
"success"
"error"
tool_call_id: str
tool_return: str
stderr: Optional[List[str]]
stdout: Optional[List[str]]
type: Optional[Literal["tool"]]

The message type to be created.

Accepts one of the following:
"tool"
ToolType = Literal["custom", "letta_core", "letta_memory_core", 8 more]
Accepts one of the following:
"custom"
"letta_core"
"letta_memory_core"
"letta_multi_agent_core"
"letta_sleeptime_core"
"letta_voice_sleeptime_core"
"letta_builtin"
"letta_files_core"
"external_langchain"
"external_composio"
"external_mcp"