add_document
Add a PDF datasheet to the store when list_documents cannot find it: copy or download the file, build its index and element map, and link it to the matching part.
Instructions
Add a PDF document to the store: copy or download it, build its index and its element map, and link it to its part. Use it when list_documents does not find the datasheet; the URL can come from a distributor tool or from the Datasheet field of a CAD symbol. The element map of a large document can take minutes: a background thread builds it, and the index and the page images are available at once. Gives the document reference, the pages, the size of the index and the state of the element map. Without part, it also gives a rough proposal of the MPN from the text of the PDF; it can be wrong. Read the MPN on page 1 of the original, then call add_document again with part. No tool removes a link of a document to a part in the store: give part only when the MPN is sure. The result gives the title of the document: the title of the PDF metadata can be wrong (a file name, a different document). No tool changes a title later: give title when you know it. The manufacturer of a datasheet comes from the datasheet: when the tool cannot read it, or the given name differs, the result asks (ASK THE USER) and links no part. To put the part into the user project: project_add_part.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "add_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| part | No | The MPN that the datasheet describes: the base part, for example TLV755P (or one variant of a family). Empty: the result proposes an MPN from the PDF. | |
| path | Yes | A local PDF file, or an http or https URL of a PDF. | |
| role | No | The role of the document: datasheet, manual, errata, appnote, package (a package drawing in its own document) or other. | datasheet |
| title | No | The title of the document, for example "TLV755P 500-mA Low-Dropout Regulator". Empty: the title of the PDF metadata. A document that the store has already keeps its title; a document of the store with no title gets this title. | |
| variants | No | The other parts that the same datasheet covers, for example ["ADC34J22", "ADC34J23"] for ADC34J24. Only with part. | |
| manufacturer | No | The manufacturer, any of its names (TI or Texas Instruments: the store knows the names of one manufacturer). Necessary only when two parts have the same MPN. With a datasheet, the tool reads the manufacturer from it: a given name must be a name of the same manufacturer. | |
| manufacturer_confirmed | No | True when the user read page 1 of the datasheet and confirms the given manufacturer, for example the maker of a module whose datasheet names the maker of its chip more often: the tool does not compare it with the text of the PDF. Give it only when the user confirms it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |