mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-29 21:33:54 +00:00
1.6 KiB
1.6 KiB
tf-sync
ToothFairyAI workspace sync layer for tfcode.
Purpose
This Python module syncs tools from a ToothFairyAI workspace to tfcode:
- MCP Servers - Tools with
isMCPServer=true - Agent Skills - Tools with
isAgentSkill=true - Database Scripts - Tools with
isDatabaseScript=true - API Functions - Tools with
requestTypeset
Installation
pip install tf-sync
Usage
from tf_sync import (
load_config,
validate_credentials,
sync_tools,
sync_mcp_servers,
ToolType,
)
# Load configuration from environment (TF_WORKSPACE_ID, TF_API_KEY, TF_REGION)
config = load_config()
# Validate credentials
result = validate_credentials(config)
if result.success:
print(f"Connected to workspace: {result.workspace_name}")
# Sync all tools (API Functions)
result = sync_tools(config)
for tool in result.tools:
print(f"- {tool.name} ({tool.tool_type.value})")
Configuration
Set these environment variables:
TF_WORKSPACE_ID- Your ToothFairyAI workspace UUIDTF_API_KEY- Your ToothFairyAI API keyTF_REGION- Region:dev,au(default),eu, orus
Region URLs
| Region | Base URL | Use Case |
|---|---|---|
dev |
api.toothfairylab.link | Development/Testing |
au |
api.toothfairyai.com | Australia (Default) |
eu |
api.eu.toothfairyai.com | Europe |
us |
api.us.toothfairyai.com | United States |
Dependencies
toothfairyai- Official ToothFairyAI Python SDKpydantic- Data validationhttpx- HTTP clientrich- Console output
License
MIT