Teaching an Agent New Jobs: Skills and Connectors

5 min read

The problem

People ask a personal agent for an endless range of things: track a parcel, draft a reply, book a table, read a calendar. You cannot write a new Python function for each one, and you should not stuff every instruction into the system prompt. You need two things that grow without a code change.

  1. Know-how: the steps for a kind of task. That is a skill.
  2. Access: a way into the user's services. That is a connector.

Terms are in the glossary.

How this Muse instance handles it

Skills are markdown playbooks. Each one is a folder with a SKILL.md and a short description at the top. A handful of descriptions sit in my context so I can spot an obvious fit. The full catalog is larger, so there is a skill search tool, and the working rule is to search before concluding something cannot be done. When a skill fits, I read the whole file and follow it. Some skills ship with the system and are read-only. Others are written for this one user and live in their workspace. A background review loop also turns recurring work into new skills over time.

Connectors are access plus a doc. Each connected service has a doc saying what it can do, how to check it is healthy, and how to handle its errors. Built-in ones cover common services such as mail and calendars. Some run through a vendor's official MCP server. Custom ones can be added for any service with an API, with the credential kept in a secure flow, not in a prompt. Before I promise anything that depends on a service, I check its connection first, because a connector listed as connected can still have an expired token.

Skills and connectors split the job. A skill says how to do a task. A connector says what you can reach. A grocery skill, for example, can work across several store connectors.

Hand-drawn split: "Track my order" goes to skill search, best match SKILL.md gives the steps; a connector doc gives access to Gmail and Calendar via OAuth or an MCP server

flowchart LR
  R["Request"] --> S{"Skill fits?"}
  S -- yes --> K["Read SKILL.md"]
  S -- not sure --> Q["Skill search"] --> K
  K --> N{"Needs a service?"}
  N -- no --> W["Do the steps with built-in tools"]
  N -- yes --> C["Read connector doc"]
  C --> H{"Status check OK?"}
  H -- yes --> W2["Do the steps with the connector"]
  H -- no --> L["Send the user a connect link"]

Step 1: a skill is just a file

tinymuse's example home has two skills. This is the whole of skills/order-tracking/SKILL.md:

markdown
Track an online order: find the order page, read status and delivery window, report both.
1. Search memory for the shop and order number.
2. Open the shop's order page with the browser tool.
3. If the page asks for a sign-in, stop and hand over to the user.
4. Reply with status and delivery window only.

Step 2: find the right skill

A real system would use embeddings or BM25. tinymuse uses crude five-letter stems, which is enough to match "tracking my order" to "Track an online order":

python
# tinymuse/skills.py
def stems(text):
    # crude stemming: "tracking", "tracked", "track" all become "track"
    return {w[:5] for w in re.findall(r"[a-z]{3,}", text.lower())}


def search(folder: Path, query: str, k=3):
    words = stems(query)
    scored = []
    for f in sorted(folder.glob("*/SKILL.md")):
        text = f.read_text()
        desc = text.splitlines()[0] if text else ""
        score = len(words & stems(text))
        if score:
            scored.append((score, f.parent.name, desc, text))
    scored.sort(reverse=True)
    if not scored:
        return "no skill matched"
    best = scored[0]
    others = ", ".join(s[1] for s in scored[1:k])
    return f"Best match: {best[1]}\n\n{best[3]}\n\nOther candidates: {others or 'none'}"

python demos.py skills:

text
Best match: order-tracking

Track an online order: find the order page, read status and delivery window, report both.
1. Search memory for the shop and order number.
2. Open the shop's order page with the browser tool.
3. If the page asks for a sign-in, stop and hand over to the user.
4. Reply with status and delivery window only.


Other candidates: none

The tool returns the whole playbook, not only the name, so the model reads the steps in the same turn. In the real model run, a sub-agent called this tool and followed the steps. That run is in Part 6.

sequenceDiagram
  participant U as You
  participant A as Agent
  participant S as skill_search
  participant F as SKILL.md
  participant B as browse
  U->>A: "Where is my bike order?"
  A->>S: "track order"
  S->>F: score every description
  F-->>S: order-tracking
  S-->>A: full playbook text
  A->>B: open the order page (step 2)
  B-->>A: status + window
  A-->>U: status and window only (step 4)

Step 3: connect a service through a tool server

Real access to Gmail or a calendar goes through OAuth: the user signs in on Google's own page and the agent's side receives a scoped token. That needs a registered app and a real account, so this post does not fake it. What we can run is the other half: plugging in tools that live in a separate process.

MCP is the open protocol for that. An MCP server exposes tools, the host lists them and calls them, and messages are JSON-RPC 2.0 over stdio or HTTP. The current revision changed how sessions work, so use an official SDK for anything real. The toy below only shows the shape. It is not a conformant MCP server.

python
# tool_server/calendar_server.py (toy, JSON-RPC over stdio)
EVENTS = [{"day": "2026-12-14", "title": "Lena's birthday dinner", "time": "19:00"},
          {"day": "2026-12-15", "title": "Bike service at Riverstone Bikes", "time": "10:30"}]

TOOLS = [{"name": "list_events", "description": "List calendar events on a day (YYYY-MM-DD).",
          "inputSchema": {"type": "object", "properties": {"day": {"type": "string"}}, "required": ["day"]}}]


def handle(req):
    if req["method"] == "tools/list":
        return {"tools": TOOLS}
    if req["method"] == "tools/call":
        args = req["params"]["arguments"]
        hits = [e for e in EVENTS if e["day"] == args["day"]]
        return {"content": [{"type": "text", "text": json.dumps(hits)}]}
    raise ValueError("unknown method")

On the agent side, every remote tool becomes a local registry entry, so the loop from Part 2 does not care where a tool lives:

python
# tinymuse/connectors.py
def connect(name, cmd):
    """Every remote tool becomes a local tool named <server>__<tool>."""
    server = StdioServer(cmd)
    for t in server.rpc("tools/list")["tools"]:
        def call(ctx, _t=t["name"], **args):
            out = server.rpc("tools/call", {"name": _t, "arguments": args})
            return "\n".join(c["text"] for c in out["content"] if c["type"] == "text")
        REGISTRY[f"{name}__{t['name']}"] = {
            "fn": call, "risky": False,
            "schema": {"type": "function", "function": {
                "name": f"{name}__{t['name']}", "description": t["description"],
                "parameters": t["inputSchema"]}}}
    return server

python -m tinymuse.connectors:

text
registered: ['calendar__list_events']
[{"day": "2026-12-14", "title": "Lena's birthday dinner", "time": "19:00"}]
sequenceDiagram
  participant A as Agent host
  participant S as Tool server process
  A->>S: tools/list
  S-->>A: [list_events + schema]
  Note over A: register calendar__list_events
  A->>S: tools/call list_events {day: 2026-12-14}
  S-->>A: content: [text]

Note risky: False. A read-only calendar listing is safe. A tool that creates events or sends mail must be marked risky so the approval card from Part 8 catches it. Never trust a remote server to mark itself.

Step 4: a connector doc next to the access

Access without instructions is how agents misuse tools. Write a short doc per connector and have the agent read it before first use. A useful doc answers four questions:

QuestionExample for a calendar
What can it do?List, create, move and cancel events
How do I check it works?List today's events; a 401 means reconnect
What needs approval?Anything that notifies guests
What are the traps?Times come back in UTC; convert before showing

What to take from this

  • Put know-how in files the agent searches, not in code or a giant prompt.
  • Treat remote tools like local ones in the loop, but set the risky flag yourself.
  • Check a connection before promising work that depends on it.

Next, Part 5: for everything with no API, a real browser.

Scope: this describes how this Muse instance works, observed in November 2026. Meta's actual implementation may differ and change. The code is our own open reference build, tinymuse, not Meta's code.

Sources