Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
KICAD_CLINoPath to kicad-cli, used to read .kicad_sch files; without it a direct single-sheet parser is used./Applications/KiCad/KiCad.app/Contents/MacOS/kicad-cli
TME_COUNTRYNoCountry used for TME API calls.PL
TME_CURRENCYNoCurrency used for TME prices.PLN
TME_LANGUAGENoLanguage used for TME API responses.en
INVENTREE_URLNoURL of your self-hosted InvenTree server. Required for the inv_* tools.
TME_APP_TOKENNoTME API app token (50 chars) created at developers.tme.eu. Required for the TME tools.
TME_APP_SECRETNoTME API app secret (20 chars) created at developers.tme.eu. Required for the TME tools.
INVENTREE_TOKENNoInvenTree API token for the user parts-mcp should act as. Required for the inv_* tools.
PARTS_EXPORT_DIRNoDirectory where Quick Buy export files are written.~/Projects/parts-orders
TME_MIN_INTERVALNoSeconds between TME API calls. TME doesn't publish a rate limit; 429/5xx responses are retried with backoff.0.25
PARTS_ALLOWED_ROOTSNoColon-separated list of roots below which bom_read may read files.~/Projects
INVENTREE_ALLOW_WRITENoMust be 1 for inv_receive with confirm=true.0
INVENTREE_SUPPLIER_NAMENoSupplier company used for TME supplier parts in InvenTree.TME

Instructions

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

Tools for buying electronic parts from TME and tracking them in a local InvenTree. Typical flow: bom_read -> inv_check_bom -> tme_lookup_mpns / tme_search + tme_parameters -> tme_quote -> (user review) -> tme_export_quickbuy. After delivery: inv_receive. Never claim an order was placed: these tools cannot order; the user uploads the Quick Buy file on tme.eu and checks out themselves.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
parts_statusA

Show configuration (no secrets) and test the TME and InvenTree connections.

bom_readA

Read one or more BOM sources and consolidate them into purchase lines.

Args: files: [{"path": "~/Projects/x/board.net", "boards": 2, "label": "main"}]. Supported: KiCad netlist (.net), KiCad schematic (.kicad_sch, exported with kicad-cli), CSV BOM. "boards" multiplies quantities (default 1). spare_policy: "default" (extra for small/losable parts) or "none".

Lines are grouped by MPN, else TME symbol, else value+package. Each line has need (= parts on the boards), spares and suggested_qty. Test points, pads, mounting holes and DNP parts are listed under "excluded" - check them.

tme_searchA

Search the TME catalogue (phrase 2-40 chars: MPN, value, keywords).

Args: sort: SYMBOL, ACCURACY, ORIGINAL_SYMBOL, PRICE_FIRST_QUANTITY, PRICE_LAST_QUANTITY, ACCURACY_IN_STOCK_FIRST or AVAILABLE_IN_STOCK_FIRST. For passives, search e.g. "100k 0603 1%" with in_stock_only=True, then confirm candidates with tme_parameters.

tme_productsA

Product details (MOQ, multiples, status, packing) for TME symbols OR manufacturer part numbers. Any length; batched by 50 internally.

tme_lookup_mpnsA

Match manufacturer part numbers to TME symbols, in bulk.

Per MPN returns status "exact" (one or more TME symbols carry exactly this MPN - e.g. cut tape vs reel), "fuzzy" (only search candidates; needs judgement) or "not_found", with MOQ/multiples and (optionally) stock and price tiers.

tme_parametersC

Technical parameters (resistance, tolerance, voltage, case...) per TME symbol.

tme_datasheetsC

Document links (datasheets, drawings) per TME symbol.

tme_prices_stockB

Stock and price tiers (your customer prices; NET/GROSS as returned) per symbol.

tme_alternativesC

Alternatives for a symbol: kind="similar" (substitutes) or "related" (accessories).

tme_deliveryC

Delivery estimate per symbol for the given quantities (same order).

tme_quoteA

Price a list of {"symbol", "qty", "ref"?} lines exactly as TME would sell them.

Rounds to MOQ/multiples, picks the price tier, and (optimize_price_breaks) moves to a higher tier when that costs no more than max_extra_cost_per_line extra. Flags: UNKNOWN_SYMBOL, NOT_IN_OFFER, CANNOT_BE_ORDERED, STOCK_SHORT_n, ROUNDED_UP_FROM_n, PRICE_BREAK_a_TO_b, HARDLY_AVAILABLE, ... Totals are in the API's currency and price type.

tme_export_quickbuyA

Write a TME Quick Buy file into PARTS_EXPORT_DIR: "SYMBOL;QTY" per line, no header, LF line endings, extension .csv (byte-for-byte the shape of TME's own cart export).

Upload only this file at tme.eu -> Quick Buy -> "Upload products from file", review, then "Add to cart". Optionally also writes review_rows (list of dicts) as -review.csv, which is for you to read and must NOT be uploaded. Existing files are never overwritten (a timestamp is appended).

inv_findA

Find parts in InvenTree by TME symbol (supplier SKU), MPN, or free-text search. Returns stock on hand, available (unallocated) quantity and locations.

inv_check_bomA

Check BOM lines (as returned by bom_read) against stock.

Per line: matches (exact via TME symbol/MPN; generic value+package lines only get search "candidates" that must be confirmed), available, and suggested_buy: 0 if available >= need, else need - available + spares.

inv_structureA

List InvenTree stock locations and part categories (ids for inv_receive).

inv_receiveA

Book delivered parts into InvenTree. Run with confirm=false first (dry run), show the plan to the user, and only call with confirm=true after they agree.

items: [{"tme_symbol", "mpn", "manufacturer", "name"?, "description", "qty", "location_id"?, "category_id"?, "unit_price"?, "currency"?, "batch"? (e.g. TME order number), "keywords"? , "value"?, "package"?, "kind"?}] Creates the part, the TME supplier part and the manufacturer part when missing (matched by TME symbol, then MPN), then adds a stock item. Needs INVENTREE_ALLOW_WRITE=1. With qty 0 (or no qty) only the part cards are created and no stock is booked. New parts and supplier parts get the TME data attribution in their notes (TME API terms 8.7, 8.8).

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

B3.4/5.0

Scored across 16 tools

Disambiguation4/5

Tools split cleanly along a workflow (BOM read → search/lookup → details/params/prices → quote/export → inventory check/receive), and prefixes make the TME vs InvenTree boundary obvious. There is mild overlap between tme_products (details, MOQ, status) and tme_prices_stock (stock/price tiers), and tme_products vs tme_lookup_mpns both accept MPNs, but descriptions clarify which to use when.

Naming Consistency4/5

Nearly everything is snake_case with a domain prefix (parts_, bom_, tme_, inv_) and a verb-ish second token, which reads predictably. The only deviations are noun-only names (tme_parameters, tme_datasheets, inv_structure) mixed with verb names like inv_find or tme_search, a minor irregularity rather than a real inconsistency.

Tool Count4/5

16 tools is at the upper end but each covers a distinct step: catalogue search, bulk MPN resolution, parameters, prices, datasheets, alternatives, delivery, quoting, export, plus four inventory tools. Nothing looks redundant enough to be dropped, though the catalogue-side tools could plausibly be consolidated.

Completeness3/5

The procure-to-stock lifecycle is covered end to end (read BOM, resolve MPNs, price/quote, export cart file, check stock, book goods in). Gaps remain: there is no way to adjust or consume existing stock, no order/PO tracking back from TME, and no tool to update or correct an already-created InvenTree part — only creation via inv_receive.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues