import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import type { BillingAdapter, BillingConfig } from "../types.js"; import { type TopUpToolOptions } from "./billing.js"; import { type MemberToolOptions } from "./members.js"; import { type SubscriptionToolOptions } from "./subscription.js"; import { type PlanCatalog } from "../plans.js"; import type { UsageLedger } from "../usage-ledger.js"; import type { Notify } from "../notifications/index.js"; import { type ToolCapabilities } from "../plan-model.js"; export declare function installInputLogging(server: McpServer): void; export interface RegisterBillingToolsOptions { adapter: BillingAdapter; config: BillingConfig; /** Per-tool credit costs (for get_credit_balance to echo). Usually from tools.json. */ toolCosts?: Record; /** Install the redacted [tool-input] logging wrapper. Default true. */ installLogging?: boolean; /** Declarative plans. When set, a `list_plans` tool is registered and the * Stripe products/prices are auto-provisioned (lazily, on first list). */ plans?: PlanCatalog; /** Default plan key (e.g. "hobby"). */ defaultPlan?: string; /** How to find the org's current plan key, when it isn't on the adapter's * subscription (gtm-tools keeps it in org metadata). Used by the usage tools * and to resolve the billing cycle a top-up is filed against. */ resolvePlan?: (orgId: string) => Promise; /** Register the billing-account tools (invoice details, tax id, saved cards). * Default true — they need only a Stripe customer. */ profileTools?: boolean; /** Register the lifecycle tools (`change_plan`, `preview_plan_change`, * `cancel_plan`, `get_plan`). Needs `plans`; pass `false` to leave plan * changes to the app's own UI. */ subscriptionTools?: boolean | Omit; /** Tax and return URLs for `buy_credits`. Supply `taxRates` on any account that * charges tax on its subscriptions: without it a top-up invoices at 0%. */ topUp?: TopUpToolOptions; /** * Per-group overrides for the surface derived from `plans`. * * The derivation is the default because the catalogue already declares every * precondition (see `toolCapabilities`), and a tool no plan can satisfy is a * false advertisement rather than merely wasted context. This is the escape * hatch for the one case the catalogue cannot express: a group the app wants * registered for a plan it has not shipped yet, or one it wants withheld * because its own UI owns the flow. An explicit value always wins. */ capabilities?: Partial; /** * The ledger the meter reads, so the tools' numbers and the gate's agree. * * `createBilling` passes the one it resolved. Hand-wired, absent means the default * composite — self-consistent, but not necessarily what the app's own meter counts with. */ usageLedger?: UsageLedger; /** * Membership: the invitation service, and which roles this deployment invites into. * * Absent still registers what the ADAPTER can answer (`list_members`, and the role/remove * pair when it implements them) — the three invitation tools are the ones with nowhere to * put a record without a service. */ members?: MemberToolOptions; /** * Fire-and-forget notifications, from `createBilling`'s emitter. * * The tools that CHANGE something somebody else is waiting on — a top-up asked for, a * request answered — say so here. Absent is a no-op, which is every deployment that * configured no notifier. */ notify?: Notify; /** * Register the OPERATOR tools (`sell_credits`, `resolve_credit_quote`). Default true. * * Set false to build the CUSTOMER's tool set. Not a security boundary — `enforceOperator` * is, wherever those tools exist — but a list that advertises "price somebody else's * workspace" to somebody who can never do it is a list that sends agents at a 403. */ operatorTools?: boolean; } export declare function registerBillingTools(server: McpServer, opts: RegisterBillingToolsOptions): void; /** * The two a customer never sees. Both name a workspace that is not the caller's. * * The REST tool list and the MCP transport hide them from everybody else; the gate that * actually refuses them is `enforceOperator`, at call time, and it does not care whether * they were advertised. */ export declare const OPERATOR_TOOL_NAMES: readonly ["quote_plan_change", "sell_credits"]; export declare const BILLING_TOOL_NAMES: readonly ["get_api_key", "list_api_keys", "create_api_key", "revoke_api_key", "get_credit_balance", "buy_credits", "preview_credit_purchase", "set_auto_reload", "get_spend_controls", "set_spend_controls", "get_billing_portal", "list_invoices", "view_invoice", "download_invoice", "list_plans", "list_members", "invite_member", "list_invitations", "revoke_invitation", "change_member_role", "remove_member", "rename_workspace", "close_workspace", "get_usage", "get_usage_limits", "get_org_usage", "list_seats", "assign_seat_type", "list_top_up_requests", "request_top_up", "approve_top_up", "grant_top_up", "deny_top_up", "accept_plan_quote", "quote_plan_change", "sell_credits", "get_billing_profile", "set_billing_profile", "set_tax_id", "list_payment_methods", "set_default_payment_method", "remove_payment_method", "get_plan", "preview_plan_change", "change_plan", "cancel_plan", "request_plan_change", "request_seat_change", "resolve_plan_request"]; //# sourceMappingURL=register.d.ts.map