getWidget
Fetch a single Brilliant Directories widget by ID or name to read its metadata or HTML, CSS, and JavaScript source for editing or auditing. Code fields stay stripped unless include_code=1 is set.
Instructions
Get a single widget - Fetch a single widget record by widget_id. Read-only.
Lean-by-default keep-list: returns only widget_id, widget_name, widget_type, short_code, date_updated, revision_timestamp, is_default. The code fields (widget_data, widget_style, widget_javascript) are stripped — restore with include_code=1.
Use when: you have a widget_id (from listWidgets or admin) and want the widget's SOURCE code to edit or audit. To preview the rendered widget on the front-end, embed it on a page as <div>[widget=Name]</div> and view the page.
Required: widget_id or widget_name.
See also: listWidgets (enumerate), updateWidget (modify).
Returns: { status: "success", message: [{...record}] } - the message array contains 1 record with all widget fields (widget_data = HTML, widget_style = CSS, widget_javascript = JS, plus metadata).
For the full field list, see listWidgets.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "getWidget"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| widget_id | No | ||
| widget_name | No | Instead of widget_id: the exact name. Returns the site's copy, else BD's widget. | |
| include_code | No | Opt in to return `widget_data`, `widget_style`, `widget_javascript` (the HTML/CSS/JS). Default stripped. Needed before `updateWidget` edits to the code. |