Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Leanfare runs every top AI model on this computer with the user's own keys, shows what each answer costs, and keeps a monthly budget. At the start of a task with several parts, call plan: it splits the task, starts Leanfare's parts at once by itself, and says in a short table which parts are yours; collect the rest of Leanfare's answers with plan_status, then review and grade each. Use delegate to hand work that reads a lot (big files, logs, many documents) to a cheaper model: Leanfare reads the files itself, so their text stays out of your context, and returns a short answer with a receipt. Use ask to hand a question to another model (Auto picks the cheapest one that rates well for the task); spend to see what was spent and saved; models to see which models and prices are available; estimate to price a prompt before sending it; trial to measure how well delegate answers on the user's models before relying on it.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
resources
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
planA

Before a task with several parts (a feature, a fix across files, a refactor, research across many files, reverse engineering a project), ask Leanfare how to split it. It answers with a short table: each part, its kind, where it runs (you, or Leanfare on a local, free or pay per use model), the model, about how long, the tokens it keeps out of the user's plan, and the cost; then what to do next. Leanfare starts its own parts at once by itself (local and free ones, paid ones within the user's cap) and this answers with those that finish within about 25 seconds: do not run them again with delegate. Do the parts it leaves to you, then call plan_status with the plan's id (wait 50) for the rest of Leanfare's answers, and review and grade each. Name the files or folders the task is about in files: here Leanfare only measures them, it reads them when delegate runs a part. A model the user ticked does the split (a few cents or less, $0 on free models; one that takes more than 40 seconds is let go, and the rules split it); split rules makes it by rules, with no model.

plan_runA

Start the parts of a plan that Leanfare runs (local, free and pay per use models), in the background: at once where they can, each as soon as the parts it needs are done, with their answers handed on. Returns at once; read the progress and the answers with plan_status. Parts on local or free models run without asking. Paid parts run only within the cap the user set in Leanfare, or when the user said yes: Leanfare asks them itself where this app can show a question; otherwise ask the user, and call again with paid yes only after they agree. The user's monthly budget in Leanfare always holds.

plan_stopA

Stop the parts of a plan that Leanfare is running (plan_run). What was done stays; a part stopped half way may have been charged.

plan_statusA

Where each part of a plan stands (waiting, running, done, failed, yours, after yours, waiting for a yes) and the answers of the parts Leanfare finished. Each answer is also saved in the project, in .leanfare/plans// (a folder git ignores), where you and the user can read it. wait: up to that many seconds for the running parts to end (it answers as soon as none is running; default 0, at most 50).

gradeA

Review every answer Leanfare brings back (delegate, or a plan's part from plan_status) before you use it, then say how good it was: good, partly or wrong. Grade a delegate answer with handoff (the number in its receipt); a plan's part with id and part. If it is partly or wrong, fix it before you answer the user: yourself (fix myself), or with fix leanfare and why, and Leanfare asks again one tier up and returns the new answer, a new hand off to review and grade too. Leanfare keeps only the grade, with the model that answered and the kind of part, never the words; why goes only to the model asked again. A model graded below good too often for a kind is moved down, so plans and delegate stop picking it for that kind. At the end of a prompt that handed work off, grade its whole result too, your work and the hand offs together: whole true and the verdict.

askA

Ask a question through Leanfare and get the answer with its cost. By default Leanfare's Auto picks the cheapest model the user ticked that rates well for the task; name a model to use that one. The cost counts toward the user's budget.

delegateA

Hand a piece of work to a cheaper model through Leanfare, to save your own context and usage. Best for work that reads a lot and answers briefly: search or summarize big files, logs or many documents, review a file, draft a section. Name the files in files: Leanfare reads them itself, so their text never enters your context. Leanfare picks the cheapest model the user ticked that rates well enough for the kind and effort, and returns a short answer with a receipt (the model, the cost, the tokens kept out of your context). Every high effort answer, and a sample of the others, is checked by a stronger model, blind and from another company when one can take it; a failed check is asked again one tier up. One that takes more than about 40 seconds answers with an id instead and keeps working: call delegate again with only that id to get the answer. Costs count toward the user's Leanfare budget.

spendB

What the user spent on AI through Leanfare today and this month, the budget left, what Auto saved against their usual model, the top models, the work Leanfare did for apps this month (plan and delegate): the share kept out of their plans, its cost and the grades; and each platform Leanfare may send work to, with what is left before its nearest limit (the 5 hours before the week).

reportA

What Leanfare did for the user's apps over a span of time: the tokens its models read so the apps did not (kept out of their plans), the apps' own use where it is known (Claude Code's, from its own files), the cost, the quality (the apps' grades and the blind checks), tokens over time, the work by model, and the last prompts with what each handed off. Each prompt has an id (PRM-41), kept for good; give prompt for one prompt and its parts. Use it when the user asks what Leanfare saved, how the models did, or for a report. Apps that show MCP Apps draw it as a card with spans to pick.

modelsB

The models the user ticked in Leanfare and can use now, with their prices in US dollars per 1M tokens and their quality rating (Arena).

estimateA

Estimate what a prompt would cost and how long it would take before sending it: the model Auto would pick, why, and at the same quality the cheapest and the fastest choice. Nothing is sent to a model.

trialA

Measure how well delegate answers on the user's models before relying on it: 10 questions with known answers about files Leanfare makes up, each asked at low, medium and high effort (30 answers, a few minutes; it costs what those answers cost, $0 on free plans). start begins it and returns at once; status gives the progress or the report, with the lowest effort that passed and the line for CLAUDE.md; stop ends it. Nothing of the user's is sent.

local_modelA

The models on this computer (Ollama): where Ollama keeps them (the drive and its free space; downloads go there too), one suggested for each kind of work (reading, drafting, working things out) with its size in GB, and a test of a model the user has. Arena rates few small models, so the test asks one of them 8 questions with known answers about made up files, on this computer (free, a few minutes, nothing leaves it); one that passes then takes reading work first in plans and the delegate. suggest (the default) says all this; test, with model, starts the test; status says how a test or a download goes; download asks the user, then has Ollama download a suggested model (model names which; the default is the best rated one). Nothing is downloaded without the user's yes.

levelA

How much to hand to Leanfare first, from 1 to 5: 1 Off (only when the user asks), 2 Light (big reads and tasks with several parts), 3 More (also reads over about 10 KB you will not change, project wide searches, summaries, reviews and first drafts), 4 Most (plan every prompt that is more than a quick question with Leanfare first), 5 All it can (every part a model can do; you review, decide and answer). Call it with nothing at the start of a chat to learn the level, and follow it. When the user sets one ("Leanfare 4", "use Leanfare less"), call it with set, and scope: chat (this chat only, the default), app (this app from now on) or default (every app). Pass the level to delegate and plan.

helperC

For Leanfare's leanfare-level mod and Claude Code's hook, not for a chat: when a Claude app is about to start a helper (a subagent), the Claude model Leanfare picks for it, by the plan part it is for or else its kind of work, as Claude's Agent tool names models (haiku, sonnet, opus, fable). With done, what a helper used once it ended; with turn, the main model's own turn. Numbers only, never words.

liveA

The model calls Leanfare is running right now, and those that ended in the last minute, as numbers only: the model, what it is for (a hand off, its check, a plan's part, an app through Leanfare's address), how long it has run, and its tokens so far by kind (new input, cached, thinking, written), with tokens a second. Use it when the user asks what Leanfare is doing now, or to watch a plan's parts run. Apps that show MCP Apps draw it as a live card that keeps moving.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
Leanfare planThe plan as a table that follows each part as it runs, for apps that show MCP Apps.
Leanfare reportThe report as a card with spans to pick, for apps that show MCP Apps.
Leanfare liveLive tokens as a card that keeps moving, for apps that show MCP Apps.

TDQS

B3.3/5.0

Scored across 16 tools

Disambiguation3/5

Several clusters overlap: ask vs delegate (both route work through Leanfare to a model), spend vs report vs live (three different time-window views of usage), and trial vs local_model (both run fixed question sets against models to gauge quality). The descriptions are unusually detailed and do distinguish them on close reading, but an agent skimming tool names could easily pick the wrong one for 'what did Leanfare do' or 'test a model'. The plan_* family itself is cleanly separated.

Naming Consistency3/5

There is a coherent plan_run/plan_status/plan_stop sub-family, but the rest mixes bare verbs (estimate, ask, delegate, grade), bare nouns (models, spend, report, level, helper, live) and one compound (local_model). Names are readable and mostly intuitive, yet there is no predictable verb_noun pattern an agent could extrapolate from.

Tool Count4/5

16 tools is at the upper edge, but the domain genuinely has several axes: cost estimation, delegation, plan lifecycle (4 tools), grading, observability (3 tools), model inventory (2 tools), and a level setting. Each tool maps to a real workflow step rather than padding. Slightly heavy, but defensible.

Completeness4/5

The core lifecycle is covered end to end: estimate before, delegate/ask/plan during, grade after, with spend/report/live for accounting and level/models/local_model for configuration. Minor gaps remain: there is no tool to set or adjust the budget/cap or to tick/untick models (deferred to the Leanfare app), and delegate work can be polled by id but not cancelled the way plan_stop cancels plans.

Maintenance

ActivityMaintained
ResponsivenessSyncing