### Install and Start Daemora
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/README.md
Commands to install the Daemora CLI globally and initialize the agent setup process.
```bash
npm install -g daemora
daemora setup
daemora start
```
--------------------------------
### Daemora Production Setup
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/README.md
Steps to install and set up Daemora for production use, including installing the package, running the setup wizard, installing the daemon, and performing a security audit.
```bash
npm install -g daemora
daemora setup
daemora daemon install
daemora daemon start
daemora doctor # verify security configuration
```
--------------------------------
### Complete Evaluation Workflow Example
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/evaluation.md
A comprehensive example demonstrating the full process of setting up and running an evaluation. This includes installing dependencies, setting environment variables, defining the evaluation file, and executing the evaluation script with specific transport and server configurations.
```bash
python scripts/evaluation.py \
-t stdio \
-c python \
-a github_mcp_server.py \
-e GITHUB_TOKEN=ghp_xxx \
-o github_eval_report.md \
my_evaluation.xml
```
--------------------------------
### Contribute to Daemora Project
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/README.md
This guide provides the necessary steps to set up the Daemora development environment for contributions. It involves cloning the repository, installing dependencies, configuring environment variables, and running initial setup and tests. It is recommended to open an issue before submitting significant pull requests.
```bash
git clone https://github.com/CodeAndCanvasLabs/Daemora.git
cd daemora-agent
pnpm install
cp .env.example .env
# Add your API keys to .env
daemora setup
pnpm test # Make sure everything passes
daemora start
```
--------------------------------
### Install from Source
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/README.md
Steps to clone the repository, install dependencies, and initialize the agent from source code.
```bash
git clone https://github.com/CodeAndCanvasLabs/Daemora.git
cd daemora-agent
pnpm install
cp .env.example .env
daemora setup
daemora start
```
--------------------------------
### Python MCP Server Example Setup (Python)
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/python_mcp_server.md
A foundational Python script for setting up an MCP (Meta Command Processor) server. It includes necessary imports, server initialization, constants, and enum definitions for service interaction.
```python
#!/usr/bin/env python3
'''
MCP Server for Example Service.
This server provides tools to interact with Example API, including user search,
project management, and data export capabilities.
'''
from typing import Optional, List, Dict, Any
from enum import Enum
import httpx
from pydantic import BaseModel, Field, field_validator, ConfigDict
from mcp.server.fastmcp import FastMCP
# Initialize the MCP server
mcp = FastMCP("example_mcp")
# Constants
API_BASE_URL = "https://api.example.com/v1"
CHARACTER_LIMIT = 25000 # Maximum response size in characters
# Enums
class ResponseFormat(str, Enum):
'''Output format for tool responses.'''
MARKDOWN = "markdown"
JSON = "json"
```
--------------------------------
### Trello API Setup and Authentication
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/trello.md
Instructions on how to get your Trello API key and token, and how to set them as environment variables. Includes a quick test to list your Trello boards.
```APIDOC
## Trello API Setup
### Get API Key
Obtain your API key from: https://trello.com/app-key
After obtaining the key, generate a token from the same page.
### Authentication
Set your Trello API Key and Token as environment variables:
```bash
export TRELLO_API_KEY="your_api_key"
export TRELLO_TOKEN="your_token"
```
### Quick Test: List Boards
This command lists all your Trello boards with their names and IDs.
```bash
curl -s "https://api.trello.com/1/members/me/boards?fields=name,id&key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" \
| python3 -c "import sys,json; [print(b['name'], '→', b['id']) for b in json.load(sys.stdin)]"
```
**Base URL**: `https://api.trello.com/1`
**Authentication**: Always append `key=$TRELLO_API_KEY&token=$TRELLO_TOKEN` to your requests.
```
--------------------------------
### Python Evaluation Harness Setup and Execution
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/evaluation.md
This section provides bash commands for setting up and running the evaluation harness for Project Daemora. It covers installing dependencies, setting API keys, and executing evaluations using different transport types (stdio, sse, http).
```bash
pip install -r scripts/requirements.txt
```
```bash
export ANTHROPIC_API_KEY=your_api_key_here
```
```bash
python scripts/evaluation.py \
-t stdio \
-c python \
-a my_mcp_server.py \
evaluation.xml
```
```bash
python scripts/evaluation.py \
-t stdio \
-c python \
-a my_mcp_server.py \
-e API_KEY=abc123 \
-e DEBUG=true \
evaluation.xml
```
```bash
python scripts/evaluation.py \
-t sse \
-u https://example.com/mcp \
-H "Authorization: Bearer token123" \
-H "X-Custom-Header: value" \
evaluation.xml
```
```bash
python scripts/evaluation.py \
-t http \
-u https://example.com/mcp \
-H "Authorization: Bearer token123" \
evaluation.xml
```
--------------------------------
### Python Dependency Installation and Environment Setup
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/evaluation.md
Commands to install project dependencies using pip and set necessary environment variables, such as API keys, required for running the evaluation script.
```bash
pip install -r scripts/requirements.txt
export ANTHROPIC_API_KEY=your_api_key
```
--------------------------------
### Install Toolkit Dependencies
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/slack-gif-creator/SKILL.md
Command to install the necessary Python libraries for image processing and GIF generation.
```bash
pip install pillow imageio numpy
```
--------------------------------
### Multi-hop GitHub MCP Question Example
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/evaluation.md
An example of a complex, multi-hop question for the GitHub MCP, requiring multiple search steps and data synthesis to arrive at the answer. It demonstrates the need for historical data analysis.
```xml
Find the repository that was archived in Q3 2023 and had previously been the most forked project in the organization. What was the primary programming language used in that repository?
Python
```
--------------------------------
### Building and Running the Server
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/node_mcp_server.md
Standard CLI commands for building, starting, and developing the TypeScript MCP server.
```bash
npm run build
npm start
npm run dev
```
--------------------------------
### Start and Manage Dev Server
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/web-development.md
Starts a development server in the background for frontend development. It requires the 'npm run dev' command and operates within the project directory. The command returns a process ID (PID) which can be used to stop the server later.
```javascript
executeCommand("npm run dev", {"background":true,"cwd":"/project"})
```
--------------------------------
### GET /tenants
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/README.md
Lists all configured tenants in the system.
```APIDOC
## GET /tenants
### Description
Retrieves a list of all registered tenants.
### Method
GET
### Endpoint
http://localhost:8081/tenants
### Response
#### Success Response (200)
- **tenants** (array) - List of tenant objects.
```
--------------------------------
### Configure AI Model Environment Variables
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/README.md
Example configuration for connecting to various AI providers and setting default models.
```env
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
DEFAULT_MODEL=openai:gpt-4.1-mini
```
--------------------------------
### Create Crew Member Directory Structure
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/crew/README.md
Initial setup for a new crew member, creating the necessary directory and files.
```bash
mkdir crew/my-crew
cd crew/my-crew
```
--------------------------------
### Project Management MCP Contextual Question Example
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/evaluation.md
An example of a question for Project Management MCP that requires understanding context rather than relying solely on keywords. It involves identifying projects based on their purpose and completion timeframe.
```xml
Locate the initiative focused on improving customer onboarding that was completed in late 2023. The project lead created a retrospective document after completion. What was the lead's role title at that time?
Product Manager
```
--------------------------------
### Example of a Good Structured Worker Task
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/orchestration.md
Illustrates a well-defined worker task using the mandatory structured brief format. This example shows how to provide detailed information for the TASK, FILES, SPEC, CONSTRAINTS, and OUTPUT fields, contrasting with a vague task description.
```plaintext
TASK: Build Express API with SQLite for todo CRUD. FILES: /project/backend/src/server.js, /project/backend/src/db.js. SPEC: GET /api/todos, POST /api/todos, PATCH /api/todos/:id, DELETE /api/todos/:id. JSON bodies. CORS for localhost:5173. CONSTRAINTS: Use better-sqlite3, zod validation. OUTPUT: Working API on port 3001.
```
--------------------------------
### Publishing Crew Packages to NPM
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/crew/README.md
Commands to initialize and publish a crew member as an npm package, and how to install it via the daemora CLI.
```bash
cd crew/my-crew
npm init -y
npm publish
daemora crew install daemora-crew-my-crew
```
--------------------------------
### Navigate to Home Directory
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/file-organizer.md
This command navigates the user to their home directory, a common starting point for file organization tasks.
```bash
cd ~
```
--------------------------------
### Tool Implementation (tools/myTool.js)
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/crew/README.md
Implements the logic for a specific tool used by the crew member. This example handles 'list', 'create', and 'delete' actions for items.
```javascript
/**
* myTool - does something useful.
*
* @param {object} params - Validated by Zod schema from index.js
* @returns {string} Result text (shown to the agent)
*/
export async function myTool(params) {
const action = params?.action || "list";
switch (action) {
case "list":
return "Found 3 items: apple, banana, cherry";
case "create":
if (!params.name) return "Error: name is required for create";
return `Created item: ${params.name}`;
case "delete":
if (!params.name) return "Error: name is required for delete";
return `Deleted item: ${params.name}`;
default:
return `Unknown action "${action}". Use: list, create, delete`;
}
}
```
--------------------------------
### GET /users/search
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/node_mcp_server.md
Search for users within the Example system using various filters and pagination options.
```APIDOC
## GET /users/search
### Description
Search for users by name or email. Supports pagination and configurable output formats.
### Method
GET
### Endpoint
/users/search
### Parameters
#### Query Parameters
- **query** (string) - Required - Search string to match against names/emails (2-200 chars).
- **limit** (integer) - Optional - Maximum results to return (1-100, default 20).
- **offset** (integer) - Optional - Number of results to skip for pagination (default 0).
- **response_format** (string) - Optional - Output format: 'markdown' or 'json' (default 'markdown').
### Request Example
GET /users/search?query=john&limit=10
### Response
#### Success Response (200)
- **results** (array) - List of matching user objects.
#### Response Example
{
"results": [
{ "id": "1", "name": "John Doe", "email": "john@example.com" }
]
}
```
--------------------------------
### Manage Server Lifecycle with with_server.py
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/webapp-testing/SKILL.md
Demonstrates how to use the helper script to manage single or multiple server processes before executing automation logic.
```bash
python scripts/with_server.py --server "npm run dev" --port 5173 -- python your_automation.py
python scripts/with_server.py \
--server "cd backend && python server.py" --port 3000 \
--server "cd frontend && npm run dev" --port 5173 \
-- python your_automation.py
```
--------------------------------
### Manage Daemora Tenants via CLI
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/README.md
Provides examples of using the Daemora command-line interface to manage multi-tenant configurations. This includes listing tenants, setting cost caps, restricting tools and MCP servers, assigning plans, managing API keys, and configuring workspaces.
```bash
# List all tenants
daemora tenant list
# Set a per-user daily cost cap
daemora tenant set telegram:123 maxDailyCost 2.00
# Restrict which tools a tenant can use
daemora tenant set telegram:123 tools readFile,webSearch,sendEmail
# Restrict which MCP servers a tenant can access
daemora tenant set telegram:123 mcpServers github,notion
# Assign a model tier
daemora tenant plan telegram:123 pro
# Store a tenant's own OpenAI key (AES-256-GCM encrypted at rest)
daemora tenant apikey set telegram:123 OPENAI_API_KEY sk-their-key
# Manage per-tenant workspace paths
daemora tenant workspace telegram:123 # Show workspace paths
daemora tenant workspace telegram:123 add /home/user # Add to allowedPaths
daemora tenant workspace telegram:123 remove /home/user
daemora tenant workspace telegram:123 block /secrets # Add to blockedPaths
daemora tenant workspace telegram:123 unblock /secrets
```
--------------------------------
### Accessing Configuration and API Keys
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/crew/README.md
Demonstrates how to retrieve configuration values during registration and how to access tenant-specific API keys at runtime within a tool.
```javascript
register(api) {
const apiKey = api.config("MY_API_KEY");
if (!apiKey) {
api.log.warn("MY_API_KEY not configured");
}
}
import tenantContext from "../../src/tenants/TenantContext.js";
export async function myTool(params) {
const store = tenantContext.getStore();
const apiKey = store?.apiKeys?.MY_API_KEY || process.env.MY_API_KEY;
}
```
--------------------------------
### Check Tmux Availability
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/tmux.md
Verifies if the tmux command-line utility is installed and available in the system's PATH. If not found, it suggests how to install it using Homebrew.
```bash
which tmux && tmux -V || echo "tmux not found - install with: brew install tmux"
```
--------------------------------
### Request File Organization Help
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/file-organizer.md
These examples demonstrate how to interact with the File Organizer skill using natural language prompts to initiate various organization tasks.
```natural language
Help me organize my Downloads folder
```
```natural language
Find duplicate files in my Documents folder
```
```natural language
Review my project directories and suggest improvements
```
```natural language
Organize these downloads into proper folders based on what they are
```
```natural language
Find duplicate files and help me decide which to keep
```
```natural language
Clean up old files I haven't touched in 6+ months
```
```natural language
Create a better folder structure for my [work/projects/photos/etc]
```
--------------------------------
### Comprehensive Tool Docstring (Python)
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/python_mcp_server.md
An example of a detailed docstring for a Python tool function. It includes a description, argument types and descriptions, return value schema, usage examples, and error handling information.
```python
async def search_users(params: UserSearchInput) -> str:
'''
Search for users in the Example system by name, email, or team.
This tool searches across all user profiles in the Example platform,
supporting partial matches and various search filters. It does NOT
create or modify users, only searches existing ones.
Args:
params (UserSearchInput): Validated input parameters containing:
- query (str): Search string to match against names/emails (e.g., "john", "@example.com", "team:marketing")
- limit (Optional[int]): Maximum results to return, between 1-100 (default: 20)
- offset (Optional[int]): Number of results to skip for pagination (default: 0)
Returns:
str: JSON-formatted string containing search results with the following schema:
Success response:
{
"total": int, # Total number of matches found
"count": int, # Number of results in this response
"offset": int, # Current pagination offset
"users": [
{
"id": str, # User ID (e.g., "U123456789")
"name": str, # Full name (e.g., "John Doe")
"email": str, # Email address (e.g., "john@example.com")
"team": str # Team name (e.g., "Marketing") - optional
}
]
}
Error response:
"Error: " or "No users found matching ''"
Examples:
- Use when: "Find all marketing team members" -> params with query="team:marketing"
- Use when: "Search for John's account" -> params with query="john"
- Don't use when: You need to create a user (use example_create_user instead)
- Don't use when: You have a user ID and need full details (use example_get_user instead)
Error Handling:
- Input validation errors are handled by Pydantic model
- Returns "Error: Rate limit exceeded" if too many requests (429 status)
- Returns "Error: Invalid API authentication" if API key is invalid (401 status)
- Returns formatted list of results or "No users found matching 'query'"
'''
```
--------------------------------
### Configure Trello Environment and List Boards
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/trello.md
Sets up the required environment variables for Trello authentication and demonstrates how to fetch and display available boards using curl and python.
```bash
export TRELLO_API_KEY="your_api_key"
export TRELLO_TOKEN="your_token"
# Quick test: list boards
curl -s "https://api.trello.com/1/members/me/boards?fields=name,id&key=$TRELLO_API_KEY&token=$TRELLO_TOKEN" \
| python3 -c "import sys,json; [print(b['name'], '→', b['id']) for b in json.load(sys.stdin)]"
```
--------------------------------
### CRM MCP Data Synthesis Question Example
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/evaluation.md
An example of a question for the CRM MCP that requires synthesizing information from multiple data types, including subscription changes, contract values, and account attributes.
```xml
Find the account that upgraded from the Starter to Enterprise plan in Q4 2023 and had the highest annual contract value. What industry does this account operate in?
Healthcare
```
--------------------------------
### Install spogo CLI for Spotify Control
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/spotify.md
Installs the spogo CLI tool, a preferred method for controlling Spotify from the terminal. It requires Homebrew and involves importing browser cookies for authentication. Includes verification steps.
```bash
# Install spogo (preferred - simpler auth)
brew tap steipete/tap && brew install spogo
spogo auth import --browser chrome # import from Chrome cookies
spogo status # verify it works
# OR: install spotify_player (alternative)
brew install spotify_player
# First run opens Spotify auth in browser
```
--------------------------------
### MCP Server Initialization and Imports (TypeScript)
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/node_mcp_server.md
Demonstrates essential imports for the MCP TypeScript SDK and the basic initialization of an McpServer instance. It includes common dependencies like the SDK server classes and Zod for validation.
```typescript
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
import axios, { AxiosError } from "axios";
const server = new McpServer({
name: "service-mcp-server",
version: "1.0.0"
});
```
--------------------------------
### Implement MCP Server Tools
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/mcp_best_practices.md
Demonstrates how to register and handle tool execution in an MCP server using both TypeScript and Python. These examples show how to define a 'calculate_sum' tool and handle its logic.
```typescript
const server = new Server({
name: "example-server",
version: "1.0.0"
}, {
capabilities: {
tools: {}
}
});
server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: [{
name: "calculate_sum",
description: "Add two numbers together",
inputSchema: {
type: "object",
properties: {
a: { type: "number" },
b: { type: "number" }
},
required: ["a", "b"]
}
}]
};
});
server.setRequestHandler(CallToolRequestSchema, async (request) => {
if (request.params.name === "calculate_sum") {
const { a, b } = request.params.arguments;
return {
content: [
{
type: "text",
text: String(a + b)
}
]
};
}
throw new Error("Tool not found");
});
```
```python
app = Server("example-server")
@app.list_tools()
async def list_tools() -> list[types.Tool]:
return [
types.Tool(
name="calculate_sum",
description="Add two numbers together",
inputSchema={
"type": "object",
"properties": {
"a": {"type": "number"},
"b": {"type": "number"}
},
"required": ["a", "b"]
}
)
]
@app.call_tool()
async def call_tool(
name: str,
arguments: dict
) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
if name == "calculate_sum":
a = arguments["a"]
b = arguments["b"]
result = a + b
return [types.TextContent(type="text", text=str(result))]
raise ValueError(f"Tool not found: {name}")
```
--------------------------------
### Registering Resources and Resource Lists
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/node_mcp_server.md
Demonstrates how to register URI-based resources and dynamic resource lists using the MCP SDK. This allows clients to discover and read data through standardized URI templates.
```typescript
import { ResourceTemplate } from "@modelcontextprotocol/sdk/types.js";
server.registerResource(
{
uri: "file://documents/{name}",
name: "Document Resource",
description: "Access documents by name",
mimeType: "text/plain"
},
async (uri: string) => {
const match = uri.match(/^file:\/\/documents\/(.+)$/);
if (!match) {
throw new Error("Invalid URI format");
}
const documentName = match[1];
const content = await loadDocument(documentName);
return {
contents: [{
uri,
mimeType: "text/plain",
text: content
}]
};
}
);
server.registerResourceList(async () => {
const documents = await getAvailableDocuments();
return {
resources: documents.map(doc => ({
uri: `file://documents/${doc.name}`,
name: doc.name,
mimeType: "text/plain",
description: doc.description
}))
};
});
```
--------------------------------
### Issue Tracker MCP Complex Aggregation Question Example
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/evaluation.md
An example of a complex aggregation question for the Issue Tracker MCP. This question requires filtering, grouping, and calculating metrics (resolution rate within a time window) across multiple issues.
```xml
Among all bugs reported in January 2024 that were marked as critical priority, which assignee resolved the highest percentage of their assigned bugs within 48 hours? Provide the assignee's username.
alex_eng
```
--------------------------------
### Get Today's AI Costs with Daemora
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/model-usage.md
This snippet shows how to retrieve today's AI cost data using the Daemora API. It makes a GET request to the /costs/today endpoint. The output is typically a JSON object containing cost information.
```bash
curl -s http://localhost:8081/costs/today
```
--------------------------------
### GET /tasks/{taskId}
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/README.md
Retrieves the status of a specific task by its ID.
```APIDOC
## GET /tasks/{taskId}
### Description
Retrieves detailed status for a specific task.
### Method
GET
### Endpoint
http://localhost:8081/tasks/{taskId}
### Parameters
#### Path Parameters
- **taskId** (string) - Required - The unique identifier of the task.
### Response
#### Success Response (200)
- **task** (object) - The task details.
```
--------------------------------
### Example Evaluation File Format
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/evaluation.md
This XML snippet illustrates the format of an evaluation file. It contains multiple `` elements, each with a question and an expected answer, used to test the MCP server's capabilities.
```xml
Find the project created in Q2 2024 with the highest number of completed tasks. What is the project name?
Website Redesign
Search for issues labeled as "bug" that were closed in March 2024. Which user closed the most issues? Provide their username.
sarah_dev
```
--------------------------------
### GET /tasks
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/README.md
Retrieves a list of recent tasks processed by the agent.
```APIDOC
## GET /tasks
### Description
Fetches the list of recent tasks.
### Method
GET
### Endpoint
http://localhost:8081/tasks
### Response
#### Success Response (200)
- **tasks** (array) - List of recent task objects.
```
--------------------------------
### Integrate Tool Annotations in Server Implementation (TypeScript & Python)
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/mcp_best_practices.md
Demonstrates how to integrate tool annotations into a server implementation using both TypeScript and Python. The TypeScript example shows defining a 'calculate_sum' tool, while the Python example uses a decorator to achieve the same, highlighting cross-language compatibility for tool definition.
```typescript
server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: [{
name: "calculate_sum",
description: "Add two numbers together",
inputSchema: {
type: "object",
properties: {
a: { type: "number" },
b: { type: "number" }
},
required: ["a", "b"]
},
annotations: {
title: "Calculate Sum",
readOnlyHint: true,
openWorldHint: false
}
}]
};
});
```
```python
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("example-server")
@mcp.tool(
annotations={
"title": "Calculate Sum",
"readOnlyHint": True,
"openWorldHint": False
}
)
async def calculate_sum(a: float, b: float) -> str:
"""Add two numbers together.
Args:
a: First number to add
b: Second number to add
"""
result = a + b
return str(result)
```
--------------------------------
### GET /mcp
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/README.md
Lists all configured Model Context Protocol (MCP) servers.
```APIDOC
## GET /mcp
### Description
Lists all MCP servers currently configured in the agent.
### Method
GET
### Endpoint
http://localhost:8081/mcp
### Response
#### Success Response (200)
- **servers** (array) - List of configured MCP servers.
```
--------------------------------
### Perform Snapshot-First Browser Automation
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/browser.md
Demonstrates the mandatory workflow of navigating to a URL, capturing an accessibility snapshot, and interacting with elements using the returned refs.
```javascript
browserAction("navigate", "https://example.com");
const tree = browserAction("snapshot");
// Assuming e5 is a button and e3 is an input field from the snapshot
browserAction("fill", "e3", "hello");
browserAction("click", "e5");
browserAction("snapshot");
```
--------------------------------
### GET /costs/today
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/README.md
Retrieves the API usage costs incurred for the current day.
```APIDOC
## GET /costs/today
### Description
Returns the total API costs for the current day.
### Method
GET
### Endpoint
http://localhost:8081/costs/today
### Response
#### Success Response (200)
- **cost** (number) - Total cost in configured currency.
```
--------------------------------
### Configuring Transport Mechanisms
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/python_mcp_server.md
Demonstrates how to run a FastMCP server using different transport protocols including Stdio, HTTP, and SSE.
```python
# Stdio
mcp.run()
# HTTP
mcp.run(transport="streamable_http", port=8000)
# SSE
mcp.run(transport="sse", port=8000)
```
--------------------------------
### POST /gif/build
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/slack-gif-creator/SKILL.md
Initializes a GIF builder instance, adds frames, and saves the final optimized GIF file.
```APIDOC
## POST /gif/build
### Description
Creates a new GIF builder session, processes frames, and exports the result with optimization settings.
### Method
POST
### Parameters
#### Request Body
- **width** (int) - Required - Width of the GIF in pixels
- **height** (int) - Required - Height of the GIF in pixels
- **fps** (int) - Required - Frames per second
- **num_colors** (int) - Optional - Number of colors for quantization (default: 128)
- **optimize_for_emoji** (bool) - Optional - Enables aggressive compression for emoji-sized GIFs
### Request Example
{
"width": 480,
"height": 480,
"fps": 20,
"num_colors": 128,
"optimize_for_emoji": false
}
### Response
#### Success Response (200)
- **status** (string) - Success message
- **file_path** (string) - Path to the saved GIF
#### Response Example
{
"status": "success",
"file_path": "output.gif"
}
```
--------------------------------
### GET /health
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/README.md
Checks the current health status of the Daemora agent server.
```APIDOC
## GET /health
### Description
Returns the operational status of the agent server.
### Method
GET
### Endpoint
http://localhost:8081/health
### Response
#### Success Response (200)
- **status** (string) - Indicates server health status.
```
--------------------------------
### GET /effects/easing
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/slack-gif-creator/SKILL.md
Calculates interpolation values for smooth motion using various easing functions.
```APIDOC
## GET /effects/easing
### Description
Computes the position or value of an object at a specific time step using predefined easing algorithms.
### Method
GET
### Parameters
#### Query Parameters
- **start** (float) - Required - Starting value
- **end** (float) - Required - Ending value
- **t** (float) - Required - Progress ratio (0.0 to 1.0)
- **easing** (string) - Required - Easing type: 'linear', 'ease_in', 'ease_out', 'bounce_out', 'elastic_out', 'back_out'
### Response
#### Success Response (200)
- **value** (float) - The calculated interpolated value
#### Response Example
{
"value": 350.0
}
```
--------------------------------
### Cost Optimization Tips
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/model-usage.md
Provides actionable tips for optimizing AI model spending.
```APIDOC
## Cost Optimization Tips
### Description
This section offers practical advice and configuration strategies to help reduce AI model API costs.
### Method
None (Informational)
### Endpoint
None (Informational)
### Parameters
None
### Request Example
None
### Response
#### Success Response (N/A)
- **Tip** (string) - A description of the optimization strategy.
#### Response Example
1. **Route by task type**: Configure `CODE_MODEL` and `RESEARCH_MODEL` in `.env` for automatic model selection based on task.
2. **Sub-agent profiles**: Utilize `spawnAgent` with a `profile` (e.g., `"researcher"`) to automatically use the appropriate model.
3. **Per-tenant limits**: Set daily cost limits for specific tenants using `daemora tenant set maxDailyCost 1.00`.
4. **Global daily cap**: Define a maximum daily spending limit via the `MAX_DAILY_COST` environment variable (e.g., `MAX_DAILY_COST=5.00`).
5. **Per-task cap**: Implement a maximum cost limit for individual tasks using `MAX_COST_PER_TASK` (e.g., `MAX_COST_PER_TASK=0.25`) to terminate expensive tasks early.
```
--------------------------------
### Organize Invoices for Taxes (CLI)
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/invoice-organizer.md
This command-line interface (CLI) interaction demonstrates how to initiate the invoice organization process for tax preparation. It assumes the user is in the directory containing the invoices.
```bash
cd ~/Desktop/receipts-to-sort
Organize these invoices for taxes
```
--------------------------------
### Implement MCP Server with TypeScript
Source: https://github.com/codeandcanvaslabs/daemora/blob/main/skills/mcp-builder/reference/node_mcp_server.md
This snippet demonstrates how to initialize an MCP server, define tool input schemas using Zod, and handle API requests. It includes error handling for Axios and setup for stdio transport.
```typescript
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
import axios from "axios";
const server = new McpServer({ name: "example-mcp", version: "1.0.0" });
const UserSearchInputSchema = z.object({
query: z.string().min(2),
limit: z.number().int().default(20)
});
server.registerTool(
"example_search_users",
{ title: "Search Users", inputSchema: UserSearchInputSchema },
async (params) => {
return { content: [{ type: "text", text: "Results..." }] };
}
);
async function main() {
const transport = new StdioServerTransport();
await server.connect(transport);
}
main().catch(console.error);
```