Skip to main content
Glama

Temsor API — Turkey & EU business data

Turkish e-Invoice Builder

tr_invoice_build

Builds a UBL-TR e-Invoice or e-Archive XML document from plain JSON, computing every total and validating the parties.

Selling into Türkiye means issuing a UBL-TR document whose element order is fixed by schema and whose totals must agree to the kuruş, or the integrator rejects it. This endpoint takes the invoice as ordinary JSON and returns the XML. Totals you send are ignored on purpose — line amounts, per-rate VAT subtotals and the payable amount are all recomputed here, because a rounding difference of one kuruş is the most common rejection. VKN and TCKN checksums are verified, and the amount is written out in Turkish words as invoices require. It does not sign the document and does not transmit it: the financial seal and the submission to the tax authority belong to your certificate and your integrator. What comes back is a document ready to enter that step.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoInvoice number. Omit and supply `series` to have it built from the series and sequence.
uuidNoDocument UUID (ETTN). Generated when omitted.
linesYes
notesNo
seriesNoThree-letter series code, used with `sequence`.
profileNoTEMELFATURA: no formal objection flow. TICARIFATURA: buyer may accept/reject. EARSIVFATURA: buyer is not an e-Invoice user.TEMELFATURA
currencyNoISO 4217. Anything other than TRY requires `exchangeRate`.TRY
customerYes
sequenceNoSequence number within the series and year.
supplierYes
issueDateYes
issueTimeNo
exchangeRateNoUnits of TRY per one unit of `currency`.
amountInWordsNoAdds the payable amount written out in Turkish words as a note, the way invoices require.
invoiceTypeCodeNoSATIS
orderReferenceIdNo
despatchDocumentIdNoDelivery note number, if the goods shipped separately.

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and does so thoroughly. It discloses that totals are recomputed and sent totals ignored, VKN/TCKN checksums are verified, the amount is written in Turkish words, and the document is neither signed nor transmitted. These are meaningful behavioral traits beyond a generic 'builds an invoice' statement and set clear expectations for side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with a one-sentence summary followed by a focused paragraph of necessary context. Every sentence adds relevant information about validation, rounding constraints, non-goals, or next steps, with no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's high complexity—17 parameters, nested objects, no output schema—the description covers input format, processing behavior, validation, limitations, and the nature of the returned artifact. It tells the agent enough to know when and how to invoke the tool and what to expect back without requiring an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 53%, so the description adds value by explaining how parameters affect output: line amounts/VAT subtotals/payable amount are recomputed, checksums on tax numbers are verified, and the amount is written in words. This goes beyond the schema's structural descriptions. It does not systematically explain every parameter, but the schema already covers many details and the description adds the most consequential behavioral semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Builds a UBL-TR e-Invoice or e-Archive XML document from plain JSON.' It clearly states the tool's transformation (JSON to XML), its domain (Turkish e-Invoice/e-Archive), and implicitly distinguishes it from siblings like tr_invoice_parse by focusing on construction rather than parsing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context: use this when selling into Türkiye and needing a UBL-TR document before the integrator step. It also communicates non-goals explicitly ('It does not sign the document and does not transmit it'), which helps the agent understand where this tool fits in a workflow. It does not explicitly name alternative tools or exclusion conditions, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4/5.0
Disambiguation4/5

Most tools have clearly distinct purposes (e.g., bic_validate vs vin_validate), but there is notable overlap: tr_validate bundles Turkish validations that are also covered individually by iban_validate and tin_validate. Also, lei_validate and lei_lookup are closely related but distinct enough. Overall, agents can usually pick the right tool, but a few pairs could confuse.

Naming Consistency4/5

Tool names are consistently snake_case with predominately verb_noun patterns (e.g., validate, lookup, screen, parse, build). Some nouns like mcp_index, model_archive, and series_history break the verb pattern but are still predictable. Minor deviations from the noun_verb form (tr_invoice_build, shipping_identify) don't cause confusion. Very readable and consistent overall.

Tool Count3/5

With 27 tools, the set is heavy, exceeding the typical 3–15 well-scoped range. However, the server covers a broad domain: international standards validation, Turkey-specific business data (fuel, labor, invoices, addresses), and even MCP/LLM model archives. The count is justifiable given the scope, but it stretches coherence and may overwhelm agents.

Completeness4/5

The tool surface is remarkably comprehensive for the stated Turkey & EU business data purpose: validators for most ID types, VAT, IBAN, phone, VIN, sanctions; plus Turkey-specific operations like invoice build/parse, labor calculations, fuel prices, business days, and address parsing. Minor gaps exist (e.g., no general exchange-rate conversion, no credit-note-specific builder), but agents can accomplish core workflows without dead ends.

Resources