add-mcp-tool
Skill2 starsChanged 6 months agoMITView on GitHub
Add a new tool to the jobtrack FastMCP server (src/jobtrack/mcp_server.py). Use this when the user asks to expose new functionality to Claude/AI clients via MCP — read tools for queries, write tools for mutations.
12 other projects use a version of this.
Adopted by
Most recently taken up by
- janusson/MSMCPtheir own version, first seen Oct 25, 2026
- skillist-io/skillisttheir own version, first seen Oct 11, 2026
- Locker-Room-Tools/synapsetheir own version, first seen Oct 11, 2026
- letehaha/moneymattertheir own version, first seen Oct 11, 2026
- openfootmanager/openfootmanagertheir own version, first seen Oct 8, 2026
- dragoscv/axiomtheir own version, first seen Sep 21, 2026
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- openfootmanager/openfootmanager★ 1.2ksame name
- letehaha/moneymatter★ 243same name
- dylanroscover/Embody★ 219same name
- tacticlaunch/mcp-linear★ 151same name
- radimsem/remindb★ 125same name
- paulieb89/property-shared★ 16same name
- plumbkit/plumb★ 4same name
- Locker-Room-Tools/synapse★ 2same name
- janusson/MSMCP★ 1same name
- skillist-io/skillist★ 1same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- add-application-fieldSkill
- add-cli-commandSkill
- smart-job-searchSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Return JSON-serializable dicts: Never return ApplicationMeta or other pydantic objects directly.
- Distinctive: line 107
All seven existing tests plus your new ones should pass.
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add a new MCP tool
The FastMCP server lives in src/jobtrack/mcp_server.py. It currently exposes seven tools: four read (list_applications, get_application, search_applications, get_recent) and three write (update_status, add_note, edit_tags).
Tools are thin: business logic stays in core.py. The MCP layer translates between strings/dicts and domain objects, and shapes error envelopes for AI callers.
Decide: read tool or write tool
The distinction matters for resolution semantics:
- Read tool — uses
core.resolve(query)directly. OnAmbiguousQuery, pick the most recent match and return its siblings in asiblings: [...]field. Reading the wrong record is recoverable; making the AI round-trip on ambiguity is annoying. Seeget_applicationfor the canonical pattern. - Write tool — uses
_resolve_strict(query). On ambiguity, returns an error dict with acandidates: [...]list and refuses to write. Writing to the wrong record is not recoverable. Seeupdate_statusfor the canonical pattern.
The pattern
- Add the tool function in
mcp_server.py, decorated with@mcp.tool. Write the docstring as if it's the user manual — FastMCP passes the docstring (includingArgs:section) verbatim to the AI client. Be explicit about valid values and resolution behavior. - Return JSON-serializable dicts. Never return
ApplicationMetaor other pydantic objects directly. Use the_summary(meta)helper for list-style returns and_full(meta)when you want meta + file contents. - Error envelope shape. Errors are returned as a dict, not raised:
Examples in-tree:return {"error": "human-readable message", "<context_field>": <useful_data>}{"error": "No application matches 'foo'"}— not found{"error": "...ambiguous...", "candidates": [ids...]}— multiple matches on a write{"error": "Invalid status 'bogus'", "valid_values": [...]}— bad enum input
- Validate enum-shaped inputs in the tool, not in core. The MCP boundary takes strings; converting
ApplicationStatus(status)inside atry/except ValueErrorlets you return thevalid_valueserror envelope instead of letting an exception bubble. - Update the registration test.
tests/test_mcp_server.py::test_mcp_lists_expected_toolshard-codes the expected tool name set. Add the new name. This test exists specifically to catch tools that get added but not surfaced. - Add a round-trip test using the
_call(name, args)helper intest_mcp_server.pyand theisolated_homefixture (autouse, fromconftest.py). At minimum cover happy path; for write tools also cover ambiguous-resolution and invalid-input cases. - Update the README under
## MCP server. Bump the tool count in the description line ("four read tools and three write tools") and add a bullet under the appropriate Read/Write section.
Skeleton — read tool
@mcp.tool
def my_read_tool(query: str, optional_filter: Optional[str] = None) -> dict:
"""One-line summary. AI clients see this.
Resolution: exact ID match wins, then company. On multiple matches,
returns the most recent with `siblings: [...]` of other candidate IDs.
Args:
query: Application ID or company name.
optional_filter: <describe>.
"""
try:
meta = core.resolve(query)
siblings: list[str] = []
except core.AmbiguousQuery as e:
meta = e.matches[0]
siblings = [m.id for m in e.matches[1:]]
except core.NotFound:
return {"error": f"No application matches {query!r}"}
# ... do read work, build result dict ...
return {"siblings": siblings, ...}Skeleton — write tool
@mcp.tool
def my_write_tool(query: str, payload: str) -> dict:
"""One-line summary.
Resolution is strict: requires an exact ID or a company name that uniquely
identifies one application. On multiple company matches, returns an error
with candidate IDs.
Args:
query: Application ID or company name.
payload: <describe>.
"""
meta = _resolve_strict(query)
if isinstance(meta, dict):
return meta # error envelope from _resolve_strict
# If payload is enum-shaped, validate here and return valid_values on failure.
# Then call into core:
updated = core.<the_business_logic>(meta.id, payload)
return {"updated": _summary(updated), <relevant_extra_fields>}Anti-patterns
- ❌ Returning bare strings or raising exceptions from a tool. Always return a dict.
- ❌ Doing filesystem work inside the tool function. That belongs in
core.py/storage.py. - ❌ Forgetting to update the
test_mcp_lists_expected_toolsset — the test will fail and someone will spend two minutes wondering why. - ❌ Using strict resolution for a read tool. Reads should be ergonomic; the latest-plus-siblings pattern is the convention.
Verify
uv run pytest tests/test_mcp_server.py -vAll seven existing tests plus your new ones should pass.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

