Skip to content

@xbbg/langgraph

Bloomberg tools for LangChain.js and LangGraph.js.

@xbbg/langgraph wraps @xbbg/core in 35 ordinary LangChain tools with bounded inputs, finite live snapshots, agent guidance, and separate model and application outputs. It is not a chat app, an MCP server, or a browser package.

Install ​

bash
npm install @xbbg/langgraph @xbbg/core @langchain/core
# For a LangChain agent
npm install langchain @langchain/openai
# For custom LangGraph graphs
npm install @langchain/langgraph

Node.js 24+

The package declares node >=24 and runs server-side. Bun is tested for @xbbg/core; @xbbg/langgraph targets Node.js.

Dependencies

Peer @langchain/core >=1.0.0 <2. Dependencies: @xbbg/core pinned to the same release (1.8.0 requires exactly 1.8.0), zod ^3.25.32 || ^4.2.0, and zod-to-json-schema.

Bloomberg runtime

Bloomberg access (Terminal/DAPI, B-PIPE, SAPI, or ZFP) and the Bloomberg SDK runtime library on the machine that runs the tools. Creating tools does not load the native addon.

Install @xbbg/core at the same version as @xbbg/langgraph so your application and the tools share one copy. The package ships CommonJS with type declarations and works with import or require. See Installation for the @xbbg/core native addon and Bloomberg runtime.

TypeScript in ES module projects

@xbbg/langgraph is published as CommonJS. In an ES module project, TypeScript resolves the package's own @langchain/core imports to LangChain's CommonJS declarations, while langchain, @langchain/langgraph, and your code use its ES module declarations, so it reports the tools as incompatible with createAgent, bindTools, and ToolNode. The examples below cast the tool list to StructuredToolInterface[] from @langchain/core/tools; CommonJS projects need no cast. The mismatch is type-only: the same tools run under LangGraph's ToolNode in ES modules.

Quick start ​

ts
import { createAgent } from "langchain";
import type { StructuredToolInterface } from "@langchain/core/tools";
import { ChatOpenAI } from "@langchain/openai";
import { BLOOMBERG_TOOL_INSTRUCTIONS, createAllBloombergTools } from "@xbbg/langgraph";

// The cast is needed only in ES module projects; see the note above.
const tools = createAllBloombergTools({ maxSecurities: 10, maxFields: 10 }) as unknown as StructuredToolInterface[];

const agent = createAgent({
  model: new ChatOpenAI({ model: "gpt-4.1" }),
  tools,
  systemPrompt: BLOOMBERG_TOOL_INSTRUCTIONS,
});

const result = await agent.invoke({
  messages: [{ role: "user", content: "Get PX_LAST for IBM US Equity." }],
});

Custom LangGraph graphs ​

Bind the tools to your model and route tool calls through ToolNode:

ts
import { AIMessage } from "@langchain/core/messages";
import type { StructuredToolInterface } from "@langchain/core/tools";
import { END, MessagesAnnotation, START, StateGraph } from "@langchain/langgraph";
import { ToolNode } from "@langchain/langgraph/prebuilt";
import { ChatOpenAI } from "@langchain/openai";
import { BLOOMBERG_TOOL_INSTRUCTIONS, createBloombergTools } from "@xbbg/langgraph";

const tools = createBloombergTools({ maxSecurities: 5, maxFields: 5 }) as unknown as StructuredToolInterface[];
const model = new ChatOpenAI({ model: "gpt-4.1" }).bindTools(tools);

const callModel = async (state: typeof MessagesAnnotation.State) => ({
  messages: [
    await model.invoke([{ role: "system", content: BLOOMBERG_TOOL_INSTRUCTIONS }, ...state.messages]),
  ],
});

const route = (state: typeof MessagesAnnotation.State) => {
  const last = state.messages.at(-1);
  return last instanceof AIMessage && last.tool_calls?.length ? "tools" : END;
};

const graph = new StateGraph(MessagesAnnotation)
  .addNode("model", callModel)
  .addNode("tools", new ToolNode(tools))
  .addEdge(START, "model")
  .addConditionalEdges("model", route)
  .addEdge("tools", "model")
  .compile();

createReactAgent from @langchain/langgraph/prebuilt also accepts these tools, though LangChain now recommends createAgent.

Tool factories ​

FactoryReturns
createAllBloombergTools(options)All 35 tools, sharing one lazily connected engine
createBloombergTools(options)The 24 request, recipe, auction, and snapshot tools
createBloombergExtTools(options)The 11 helper tools (BLOOMBERG_EXT_TOOL_NAMES)
createBdpTool(options) and the other single-tool factoriesOne tool. The name is create, the tool name without xbbg_ in PascalCase, and Tool: createBdpTool builds xbbg_bdp, createExtChartSpecTool builds xbbg_ext_chart_spec
  • BLOOMBERG_TOOL_NAMES lists all 35 names; its element type is BloombergToolName.
  • disabledTools removes named tools from the three group factories.
  • Every tool is a LangChain StructuredToolInterface (exported as BloombergTool) with responseFormat: "content_and_artifact".
  • Each factory call has its own engine resolver. Separate createBloombergTools() and createBloombergExtTools() calls, or several single-tool factories, each connect their own engine on first use unless you pass engine. Use createAllBloombergTools() or a shared engine to keep one connection.
ts
import { createAllBloombergTools, createBdpTool } from "@xbbg/langgraph";

const tools = createAllBloombergTools({ disabledTools: ["xbbg_bql", "xbbg_bsrch"] });
const bdpOnly = createBdpTool({ maxSecurities: 3 });

Agent instructions ​

BLOOMBERG_TOOL_INSTRUCTIONS is system-prompt text for the model. It tells the model to ask before choosing an ambiguous security, field, date range, currency, periodicity, timezone, override, or universe; to pass securities exactly as supplied (<TICKER> <MARKET_SECTOR>, /isin/<ISIN>, or /cusip/<CUSIP>) and never guess a ticker; to look up uncertain fields with xbbg_bflds; to issue one call per dataset; to prefer recipes and bounded snapshots; and to report empty, truncated, or errored results directly.

getBloombergToolInstructions({ includeExtensionGuidance, includeLimitReminder }) builds the same text with optional sections; both default to true.

ts
import { createBloombergTools, getBloombergToolInstructions } from "@xbbg/langgraph";

const tools = createBloombergTools();
const systemPrompt = getBloombergToolInstructions({ includeExtensionGuidance: false });

Options ​

Numeric options must be positive safe integers; invalid values throw a RangeError when the tools are created.

OptionDefaultMinimumBounds
maxSecurities251Securities per request
maxFields251Fields per request, and entries per kwargs map and per nested override map
maxRows5001Aggregate primary rows in the application artifact
maxResultBytes1,048,576256UTF-8 bytes of the serialized artifact, including its envelope
maxContentRows501Aggregate primary rows in model-facing content
maxContentBytes65,536256UTF-8 bytes of the model-facing content, including the summary line
maxResultNodes50,00010Aggregate inspection work across materialization and both projections
maxStringChars2,0001String length in inputs and results
maxBqlQueryChars4,0001BQL query length
maxSearchSpecChars1,0001Search specification length
maxStreamUpdates101Largest maxUpdates a snapshot accepts
maxStreamWaitMs15,0001Largest and default snapshot timeoutMs
OptionMeaning
engineA connected @xbbg/core engine, used as-is. Its configuration and lifecycle stay with you
engineConfigEngineConfig passed to connect() for the lazily connected engine; ignored when engine is set
coreA module object with connect() and ext, used instead of importing @xbbg/core
validateFieldsDefault field validation for xbbg_bdp, xbbg_bdh, xbbg_bds, and the CDX bundles; a per-call validateFields wins
disabledToolsTool names left out of the group factories

String values and keys in kwargs and overrides are trimmed and limited to maxStringChars. Flat kwargs and each nested override map allow at most maxFields entries; the outer overrides map allows maxFields + maxSecurities entries for global and per-security overrides. Oversized maps or strings, empty keys or strings, and keys that collide after trimming are rejected before any Bloomberg work starts.

Engines and timeouts ​

By default the first tool call imports @xbbg/core, calls connect(engineConfig), and reuses that engine for every tool from the same factory call. Parallel calls share one in-flight connection, and a failed connection is retried on the next call.

@xbbg/core sets no request timeout by default, so lazily connected engines get DEFAULT_ENGINE_REQUEST_TIMEOUT_MS (60,000 ms) unless engineConfig.requestTimeoutMs is set; 0 disables it. A supplied engine is never reconfigured or disconnected.

In @xbbg/core 1.8.0, the engine's keyColumn names the column that holds each row's security. The default, "ticker", is deprecated: the first result that uses it emits one DeprecationWarning per process (code XBBG_TICKER_KEY_COLUMN). Set keyColumn: "security" in engineConfig or in your own engine's configuration to switch.

ts
import * as xbbg from "@xbbg/core";
import { createBloombergExtTools, createBloombergTools } from "@xbbg/langgraph";

const engine = await xbbg.connect({ host: "localhost", port: 8194, requestTimeoutMs: 30_000 });
const tools = [...createBloombergTools({ engine, maxRows: 200 }), ...createBloombergExtTools({ engine })];

// ... run the agent ...

engine.signalShutdown(); // the application owns the engine's lifecycle

Or let the tools connect lazily with your configuration:

ts
import { DEFAULT_ENGINE_REQUEST_TIMEOUT_MS, createAllBloombergTools } from "@xbbg/langgraph";

const tools = createAllBloombergTools({
  engineConfig: { host: "localhost", port: 8194, requestTimeoutMs: 2 * DEFAULT_ENGINE_REQUEST_TIMEOUT_MS },
});

See Configuration for EngineConfig.

Cancellation ​

Tools honor LangChain's AbortSignal: pass { signal } to graph.invoke, agent.invoke, or tool.invoke. ToolInvocationConfig ({ readonly signal?: AbortSignal }) is the part of the runnable config that reaches the tool functions, exported for custom integrations.

  • A call whose signal is already aborted rejects without starting Bloomberg work, and an aborted call rejects immediately.
  • Snapshot tools stop collecting and unsubscribe at once, skipping drain, instead of waiting out timeoutMs.
  • In-flight request/response calls cannot be cancelled mid-request; the engine request timeout bounds them.
ts
import { createBdpTool, type ToolInvocationConfig } from "@xbbg/langgraph";

const bdp = createBdpTool();
const controller = new AbortController();
const config: ToolInvocationConfig = { signal: controller.signal };
setTimeout(() => controller.abort(), 5_000);

try {
  await bdp.invoke({ securities: ["IBM US Equity"], fields: ["PX_LAST"] }, config);
} catch (error) {
  console.error("xbbg_bdp failed or was cancelled:", error);
}

Errors are rethrown as <tool> failed: <message>, keeping the original error's name and the original error as cause.

Results ​

Each call produces two independently bounded projections of the same result: model-facing content (maxContentRows, maxContentBytes) and an application artifact (maxRows, maxResultBytes). A smaller preview never shrinks the artifact. Invoke with a tool call, as agents and ToolNode do, to receive a ToolMessage with both; bare arguments return only the content string.

ts
import type { ToolMessage } from "@langchain/core/messages";
import { createBdpTool, type ToolEnvelope } from "@xbbg/langgraph";

const bdp = createBdpTool({ maxSecurities: 1, maxFields: 1 });
const message: ToolMessage = await bdp.invoke({
  type: "tool_call",
  id: "reference-price",
  name: "xbbg_bdp",
  args: { securities: ["IBM US Equity"], fields: ["PX_LAST"] },
});
const artifact = message.artifact as ToolEnvelope;
console.log(artifact.rowCount, artifact.truncated, artifact.data);

The artifact is a ToolEnvelope:

KeyMeaning
toolTool name
rowCountSource row count when known, else null; not the number of rows kept
truncatedtrue when the artifact omitted or shortened anything
truncationOptional ResultTruncationSummary: reasons, plus inspectedNodes, retainedNodes, omittedRows, and omittedPropertiesAtLeast when available
hasErrorsPresent as true when Bloomberg errors were detected
dataThe bounded result: an array of rows or, when the result carries metadata, an object with rows and any of securityErrors, fieldErrors, fieldExceptions, eidData, delayed, and metadata

Content starts with a summary line, then the content JSON (tool, rowCount, truncated, contentTruncated, and the bounded data). For example, the first line of a chart-spec call:

xbbg_ext_chart_spec: 2 rows; artifactTruncated=false; contentTruncated=false; artifactReasons=none; contentReasons=none
  • truncated describes the artifact; contentTruncated and the summary's reason lists describe the preview. Very small byte budgets reduce content to a compact summary.
  • Truncation reasons: max_rows, max_string_chars, max_result_bytes, max_result_nodes, max_result_depth, circular_reference, binary_data, accessor_omitted, unsupported_value, invalid_entitlement_data, entitlement_limit, upstream_truncation. Lower-bound counts do not claim an exhaustive scan.
  • Empty results carry empty result; verify identifiers, fields, and date range before concluding no data exists in the summary.
  • Bloomberg errors are kept ahead of ordinary data; content can list them under diagnostics even when rows are omitted.
  • The row limits do not discard attached eidData, delayed, metadata, securityErrors, fieldErrors, or fieldExceptions, though byte, node, string, and entitlement limits still apply. Depth is capped at 32, and binary data becomes a bounded placeholder.
  • fieldErrors holds the field ids Bloomberg refused; xbbg_bflds reports them even when no field was answered, and its rows end with the field id column. @xbbg/core 1.8.0 stores field exceptions as a compact dictionary; the tools expand only the diagnostics they keep and omit unreadable ones with the unsupported_value reason instead of failing the result.
  • Finite requests use @xbbg/core's JSON backend (backend: "json"). The node budget is aggregate across the whole result and both projections.

toolParameterJsonSchema(tool) returns the provider-ready JSON Schema for a tool's input: $ref-free, input side of transforms, frozen, and identical to the schema embedded in the tool's provider definition. Use it instead of converting the zod schema yourself:

ts
import { createAllBloombergTools, toolParameterJsonSchema } from "@xbbg/langgraph";

const definitions = createAllBloombergTools().map((tool) => ({
  name: tool.name,
  description: tool.description,
  parameters: toolParameterJsonSchema(tool),
}));

Schemas only advertise parameters the engine accepts: format exists on xbbg_bdp and xbbg_bdh only. Dates accept YYYY-MM-DD or YYYYMMDD strings, integer YYYYMMDD values, and epoch milliseconds; ambiguous numbers and MM/DD/YYYY strings are rejected, and Date objects are not part of the JSON wire contract.

Snapshots ​

Live data is exposed only as finite snapshots: xbbg_stream_snapshot (//blp/mktdata, tickers and fields), xbbg_mktbar_snapshot (//blp/mktbar, one ticker), and xbbg_depth_snapshot (//blp/mktdepthdata, one ticker).

  • maxUpdates is required and at most maxStreamUpdates; timeoutMs defaults to maxStreamWaitMs and cannot exceed it.
  • Optional controls: drain (default false), allFields, conflate, flushThreshold, streamCapacity, overflowPolicy, and Bloomberg subscription options.
  • overflowPolicy accepts drop_newest or block. When omitted, snapshots use drop_newest regardless of the engine's defaults, because snapshot rows carry no delivery-gap envelopes; @xbbg/core's gap-aware drop_oldest and state deliveries are not exposed as snapshots.
  • Collection stops at maxUpdates, the timeout, or stream completion, then calls unsubscribe(drain). The result has updateCount, maxUpdates, timeoutMs, reason (max_updates, timeout, or done), and updates. If collecting succeeded but unsubscribing failed, the updates are kept and unsubscribeError reports the failure; a collection error stays the thrown error.
  • Arrow updates share one allowance of at most min(max(maxRows, maxContentRows), floor(maxResultNodes / 3)) rows. An update cut short carries rowCount, rows, truncated, and truncation with reason: "max_rows" and omittedRowsAtLeast.

Entitlements and delayed data ​

  • returnEids: true is accepted by xbbg_bdp, xbbg_bds, xbbg_bdh, xbbg_bdib, and xbbg_bdtick. Retained IDs appear as eidData in data; eidDataTruncation, when present, reports retained and omitted IDs and whether totals are complete. Pass the IDs to xbbg_check_entitlements:
json
{ "eids": [101, 202], "service": "//blp/refdata" }
  • xbbg_delay_status (securities, optional checkIdentity) returns one row per unique security with delayed, delay_minutes, exchange_delay, exch_code, realtime_eid1 to realtime_eid4, delayed_eid, and error; EIDs are decimal strings in JSON. checkIdentity: true adds realtime_entitled and delayed_entitled and needs an EMRS-enrolled Desktop user or SAPI/B-PIPE authorization.
  • onDelayed ("warn", "raise", or "ignore") on xbbg_bdp, xbbg_bdh, xbbg_bdib, and xbbg_bdtick: raise fails the call when Bloomberg delivers delayed data; warn and ignore attach a per-security delayed map, and warn also emits a BlpDelayedDataWarning process warning from @xbbg/core. History and intraday tools check only windows that reach the last 24 hours; xbbg_bds has no onDelayed.
json
{
  "tool": "xbbg_bdp",
  "data": {
    "rows": [{ "ticker": "<TICKER> <MARKET_SECTOR>", "field": "<FIELD>", "value": "<VALUE>" }],
    "delayed": { "<TICKER> <MARKET_SECTOR>": { "delayed": true, "delay_minutes": 15 } },
    "metadata": {
      "xbbg.delayed": "{\"<TICKER> <MARKET_SECTOR>\":{\"delayed\":true,\"delay_minutes\":15}}"
    }
  },
  "rowCount": 1,
  "truncated": false
}

See Entitlements for the Bloomberg concepts behind these tools.

Auction tools ​

xbbg_resolve_venues and xbbg_auction_snapshot take securities (Bloomberg tickers, valid bare ISINs, /isin/<ISIN>, or /bbgid/<FIGI>) and optional pcsOverrides, such as { "NEW YORK": "SNY2" }. They keep one row per input in input order, including duplicates, with status (resolved, unresolved, unsupported, or mismatch) and error; auction fields are null on failed rows. xbbg_auction_snapshot takes optional fields in column order; omit them or pass [] for AuctionFields.default, and maxFields applies only to fields you supply. In the JSON rows, Arrow Int64 and Time64 microsecond values become decimal strings, and Date32 values become UTC-midnight epoch milliseconds.

ts
import { createAuctionSnapshotTool, createResolveVenuesTool } from "@xbbg/langgraph";

const venues = createResolveVenuesTool();
const auction = createAuctionSnapshotTool();

await venues.invoke({ securities: ["IBM US Equity", "AAPL US Equity"] });
await auction.invoke({
  securities: ["IBM US Equity"],
  fields: ["IMBALANCE_INDIC_RT", "ORDER_IMB_BUY_VOLUME", "ORDER_IMB_SELL_VOLUME"],
  pcsOverrides: { "NEW YORK": "SNY2" },
});

See Exchange Auctions for venue routing and Recipes for the @xbbg/core recipes behind these tools.

Chart specs ​

xbbg_ext_chart_spec (createExtChartSpecTool()) turns bounded rows from an earlier data tool into an inline Vega-Lite specification. It neither fetches Bloomberg data nor renders images, and it loads nothing from @xbbg/core.

json
{
  "source": "bdh",
  "rows": [{ "ticker": "AAPL US Equity", "date": "20240102", "value": 190.1 }],
  "xField": "date",
  "yFields": ["value"],
  "seriesField": "ticker",
  "title": "AAPL PX_LAST"
}
  • Inputs (ChartSpecInput): source (bdh, bdib, holdings, depth, or rows), rows (at most maxRows), and optional chart (line, area, bar, scatter, candlestick, or depth; the default follows source), renderer ("vega-lite"), title, maxPoints, xField, yFields, seriesField, labelField, valueField, openField, highField, lowField, closeField, sideField, priceField, and sizeField.
  • Output (ChartSpecOutput, the artifact's data): kind ("xbbg.visualization"), version, component ("xbbg_chart"), renderer, rowCount, inputRowCount, truncatedInput, source, chart, summary, spec (VegaLiteSpec with inline data.values), and warnings. maxPoints truncation keeps a valid spec and adds a warning.
  • Register an xbbg_chart component in your frontend and render data.spec with your Vega-Lite wrapper; the payload has no renderer dependency, so generative-UI frontends such as CopilotKit, assistant-ui, or LangGraph UI can display it. There is no renderable flag in JavaScript, so check the envelope's truncated before treating a clipped artifact's spec as complete.

Version notes ​

  • 1.8.0: snapshots default overflowPolicy to drop_newest independently of engine defaults, fieldErrors joins the retained diagnostics, and compact field exceptions are expanded only for retained diagnostics. With @xbbg/core 1.8.0, xbbg_bflds rows gain the field id column and the ticker key column is deprecated.
  • 1.6.0: CDX recoveryRate on xbbg_ext_cdx (cdx_pricing, cdx_risk) is a percentage from 0 to 100 sent as the CDS_RR override: pass 40 for 40%, not 0.4. Releases 1.3.0 through 1.5.x validated it as a 0–1 decimal.
  • 1.6.0: the predefined CDX bundles (8, 10, and 6 fields) enforce maxFields before connecting and forward validateFields, and kwargs and override maps enforce the string, entry, and unique-key limits above.
  • 1.6.0: the no-op activeOnly option is gone from xbbg_corporate_bonds.
  • 1.3.0: format was removed from the xbbg_bds, xbbg_bql, xbbg_bsrch, xbbg_bflds, and xbbg_beqs schemas (a model-sent value is stripped), and Date objects left the wire contract.

Tool reference ​

Required inputs are listed first.

ToolPurposeInputs
xbbg_bdpReference datasecurities, fields; overrides, kwargs, format (long, long_typed, long_metadata), includeSecurityErrors, validateFields, returnEids, onDelayed
xbbg_bdhHistorical seriessecurities, fields, start, end; format (adds semi_long), overrides, kwargs, validateFields, returnEids, onDelayed
xbbg_bdsOne bulk or table fieldsecurities, field; overrides, kwargs, validateFields, returnEids
xbbg_bdibIntraday barsticker, start, end, interval; eventType, requestTz, outputTz, kwargs, returnEids, onDelayed
xbbg_bdtickIntraday ticksticker, start, end; eventTypes, seven include* flags, requestTz, outputTz, kwargs, returnEids, onDelayed
xbbg_check_entitlementsCheck entitlement IDseids (1 to 10,000 positive 32-bit IDs); service (default //blp/refdata)
xbbg_delay_statusDelayed or real-time status per securitysecurities; checkIdentity
xbbg_bqlOne complete BQL expressionquery; kwargs
xbbg_bsrchSaved search or gridsearchSpec; kwargs, overrides
xbbg_bqrFixed-income dealer quotesticker, start, end; eventTypes, includeBrokerCodes
xbbg_bfldsField metadata and search; rows end with the field id columnExactly one of fields or searchSpec; kwargs
xbbg_beqsNamed Bloomberg equity screenscreen; asof, group, screenType, kwargs, overrides
xbbg_yasYAS yield and spread analyticstickers, fields; settleDt, yieldType, yieldVal, price, spread, benchmark
xbbg_preferredsPreferreds from the issuer's common equity tickerequityTicker; fields
xbbg_corporate_bondsCorporate bond universe of a companyticker; ccy, fields
xbbg_index_membersIndex constituentsindex; asof, field (INDX_MWEIGHT, INDX_MEMBERS, INDX_MEMBERS3)
xbbg_resolve_isinsResolve raw ISINsisins
xbbg_resolve_venuesValidated auction venuessecurities; pcsOverrides
xbbg_auction_snapshotAuction and imbalance fields on primary venuessecurities; fields, pcsOverrides
xbbg_issuer_isinsIssuer ISINs from bond ISINsbondIsins
xbbg_etf_holdingsETF holdingsetfTicker; fields
xbbg_stream_snapshotFinite //blp/mktdata snapshottickers, fields, maxUpdates; snapshot controls
xbbg_mktbar_snapshotFinite //blp/mktbar snapshotticker, maxUpdates; fields, snapshot controls
xbbg_depth_snapshotFinite //blp/mktdepthdata snapshotticker, maxUpdates; fields, snapshot controls
xbbg_ext_tickerTicker hygieneoperation: parse_ticker (generic futures-style tickers only), normalize_tickers, filter_equity_tickers, is_specific_contract, validate_generic_ticker
xbbg_ext_futuresFutures contract construction and selectionoperation: build_futures_ticker, generate_candidates, contract_index, filter_candidates_by_cycle, filter_valid_contracts, get_futures_months
xbbg_ext_cdxCDX parsing, series, and data bundlesoperation: parse_cdx_ticker, previous_cdx_series, cdx_gen_to_specific, cdx_info, cdx_pricing, cdx_risk (recoveryRate 0–100)
xbbg_ext_currencyCurrency planning, not FX quotesoperation: build_fx_pair, same_currency, currencies_needing_conversion
xbbg_ext_bql_builderBuild, but do not run, recipe BQLoperation: build_preferreds_query, build_corporate_bonds_query, build_etf_holdings_query
xbbg_ext_chart_specVega-Lite spec from rowssource, rows; chart options
xbbg_ext_market_sessionSession, timezone, and exchange-override lookupsoperation: derive_sessions, get_market_rule, infer_timezone, session_times_to_utc, default_turnover_dates, default_bqr_datetimes, get_exchange_override, list_exchange_overrides
xbbg_ext_yas_overridesYAS override map for lower-level requestssettleDt, yieldType, spread, yieldVal, price, benchmark (all optional)
xbbg_ext_constantsConstant lookupsoperation: parse_date, fmt_date, get_month_code, get_month_name, get_futures_months, get_dvd_type, get_dvd_types, get_dvd_cols, get_etf_cols
xbbg_ext_columnsColumn rename helpersoperation: rename_dividend_columns, rename_etf_columns, build_earning_header_rename
xbbg_ext_calculateLevel percentagesoperation: calculate_level_percentages; values, levels (same length)

Helper tools call @xbbg/core's local ext helpers and do not connect to Bloomberg, except the cdx_info, cdx_pricing, and cdx_risk bundles, which run a reference-data request.

MCP Server

Give Claude Code, OpenCode, or Claude Desktop Bloomberg tools without writing an agent.

Recipes

The @xbbg/core recipes behind the recipe and auction tools.

Entitlements

Entitlement IDs, identity checks, and delayed-data status.

xbbg is independent open-source software and is not affiliated with, endorsed by, sponsored by, or approved by Bloomberg Finance L.P.