Python SDK for writing Fathom skills — typed Ctx, fetch+secrets helpers, manifest types.
Project description
fathom-skill
Python SDK for writing Fathom
skills. Typed Ctx, fetch + secret helpers, manifest types — small
package, zero runtime dependencies.
Install
pip install fathom-skill
Requires Python 3.10+ and the Fathom gateway at v0.8.0 or later (earlier gateways only run Node skills).
Quick start
# my-skill/index.py
from fathom_skill import Ctx, require_fetch, require_secret
async def search(params: dict, ctx: Ctx) -> dict:
fetch = require_fetch(ctx)
res = await fetch(
f"https://api.example.com/search?q={params['query']}",
attach=[{"type": "bearer", "secret": "EXAMPLE_API_KEY"}],
)
return {"body": res["body"]}
# my-skill/skill.manifest.yaml
name: my-skill
version: "1.0.0"
author: you@example.com
signature: ed25519:builtin
language: python # tells Fathom to run via runner.py
permissions:
network:
- GET https://api.example.com/*
secrets:
- EXAMPLE_API_KEY
tools:
- name: search
function: search
description: Search the example API for a query.
Drop this directory into your Fathom skills/ folder. The agent
loads it on next start.
Sync skills
Functions don't have to be async. The runner detects sync vs async
via inspect.iscoroutinefunction and dispatches accordingly:
def echo(params: dict, ctx: Ctx) -> dict:
return params
If your skill makes HTTP calls via ctx.fetch you need async def
because fetch is awaitable. Pure-compute skills can stay sync.
Credential attaches
from fathom_skill import BearerAttach, HeaderAttach, BasicAttach, GoogleOauthAttach
| Type | What it does |
|---|---|
bearer |
Authorization: Bearer <secret> |
header |
Arbitrary header with optional template (Bot ${secret} etc.) |
basic |
Authorization: Basic base64(user:pass) |
google-oauth |
Refresh-token rotation; injects fresh access token |
Manifest typing
from fathom_skill import SkillManifest
manifest: SkillManifest = {
"name": "my-skill",
"version": "1.0.0",
"author": "you@example.com",
"signature": "ed25519:builtin",
"language": "python",
"permissions": {
"network": ["GET https://api.example.com/*"],
"secrets": ["EXAMPLE_API_KEY"],
},
"tools": [
{
"name": "search",
"function": "search",
"description": "Search the example API for a query.",
},
],
}
Reference
Ctx— runtime context protocol with optionalget_secret+fetch.require_fetch(ctx)/require_secret(ctx, name)— narrow to non-optional, raise with a useful message if the runtime didn't provide it.EgressAttachunion —BearerAttach | HeaderAttach | BasicAttach | GoogleOauthAttach.SkillManifest,SkillPermissions,SkillTool— typed mirror ofskill.manifest.yaml.
See also
fathom-sdk— Python client for the Fathom gateway (for calling the agent from your code, distinct from skills which are invoked by the agent).@darklake.ai/fathom-skill— the sibling SDK for TypeScript skills.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fathom_skill-0.1.0.tar.gz.
File metadata
- Download URL: fathom_skill-0.1.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0ea8797bf67babdb65567e600c46bdd04d7bc5d061906a03f75c3d3b6876f1f
|
|
| MD5 |
9d9696fd2a47ca83f367e2e9f593a29b
|
|
| BLAKE2b-256 |
955e755c5a90e76d2dc410d728fad31fe6e8e01391afc08b6c394ba25ccdc626
|
File details
Details for the file fathom_skill-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fathom_skill-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6a2c6cfdb1d03d3c8e083834d37d90b17e747f642ffb04f17e0d7676f2a73dc
|
|
| MD5 |
c8060e61af3277e1f018a4d0aff065a7
|
|
| BLAKE2b-256 |
36e8d314715582ee1fc8a1e38c6f30ec00ce944204d4900245ccc9cb19c06440
|