Skip to content
DFL / MCP
esc
↑↓navigate ↵open ⌘↵copy tool name

Strategy

Create and update Business Model Canvas data in strategy.* — business units, the 9 canvas blocks, moats, typed business-unit relationships, assumptions, provenance sources, draft canvas snapshots, competitors and personas.

Connector
https://mcp.devfellowship.com/mcp
Tools
103 in 18 groups
Package
packages/dfl-mcp-strategy
Auth
Sign in once on the DFL connector. Every call runs as you, under RLS and your IAM role. See Auth & security.

Connect

Add the one DFL connector, https://mcp.devfellowship.com/mcp, to your client. Sign in once. On the consent page choose the strategy domain: read gives the scope strategy.read, and write gives strategy.write. The steps for each client are on Connect the DFL MCP.

Then find a tool of this domain with the router tools of the connector:

  1. search_tools with a keyword or an exact tool name. Each result gives strategy.<tool> and its mode (read or write).
    {
      "query": "list_canvas_business_units"
    }
  2. describe_tool with that id for the description and the input schema.
    {
      "tool": "strategy.list_canvas_business_units"
    }
  3. call_read_tool for a read tool, or call_write_tool for a write tool, with the id and the arguments.

Scripts and agents that sign in with a token: see Getting started, For scripts.

Backing datastrategy.business_units, .value_propositions, .customer_segments, .customer_relationships, .channels, .revenue_streams, .key_partners, .key_activities, .resources, .expense_categories, .business_unit_relationships, .assumptions, .moats, .sources, .artifact_sources, .canvas_snapshots, .competitors, .entities, .personas, .customer_insights, .insight_evidence, .insight_curated_links, .competitor_ads, and social_proof.testimonials (review excerpts).

These tools manage the canvas record of a business unit (strategy.business_units). The business unit itself (public.business_units: name, tags, image) belongs to the work host — list_business_units and its family there. A canvas row links to it through business_unit_id. The *_canvas_business_unit names replace the old *_business_unit names in this domain, which collided with the work tools.

The Business Model Canvas record of each business unit: list, create, edit, archive.

list_canvas_business_units

List strategy.business_units rows — the Business Model Canvas record of a business unit.read

List Canvas Business Units

List strategy.business_units rows — the Business Model Canvas record of a business unit. Not the work business unit: that is public.business_units on the work host (list_business_units there). By default excludes archived units — pass include_archived: true to see everything. business_unit_id on the row links the canvas to its public.business_units row (the work-host business unit).

ParameterTypeRequiredDescription
include_archivedbooleannoInclude is_archived=true rows. Default: false.
parent_business_unit_idstringnoFilter to the canvases linked to this public.business_units.id (the work-host business unit; column business_unit_id on the row)
limitnumbernoDefault: 50.

get_canvas_business_unit

Fetch one strategy.business_units row (the canvas record of a business unit) by id.read

Get Canvas Business Unit

Fetch one strategy.business_units row (the canvas record of a business unit) by id. Not the work business unit: that is public.business_units on the work host (list_business_units there).

ParameterTypeRequiredDescription
idstringyesstrategy.business_units.id.

create_canvas_business_unit

Create a strategy.business_units row — the root entity every BM Canvas block (value propositions, customer segments, channels, etc.) hangs off of via business_unit_id.write

Create Canvas Business Unit

Create a strategy.business_units row — the root entity every BM Canvas block (value propositions, customer segments, channels, etc.) hangs off of via business_unit_id. golden_circle_why/how/what are free-form jsonb (Simon Sinek framing). Not the work business unit: that is public.business_units on the work host (list_business_units there).

ParameterTypeRequiredDescription
namestringyesBusiness unit name.
descriptionstringno—
sectorstringno—
tagsstringno—
colorstringnoHex or CSS color used by the canvas UI.
logo_urlstringno—
business_unit_idstringnopublic.business_units.id (the work-host business unit) this canvas belongs to. FK, ON DELETE CASCADE.
golden_circle_whyobjectno—
golden_circle_howobjectno—
golden_circle_whatobjectno—

update_canvas_business_unit

Partially update a strategy.business_units row (the canvas record of a business unit) by id.write

Update Canvas Business Unit

Partially update a strategy.business_units row (the canvas record of a business unit) by id. Only the fields provided are changed. Not the work business unit: that is public.business_units on the work host (list_business_units there).

ParameterTypeRequiredDescription
idstringyesstrategy.business_units.id.
namestringno—
descriptionstringno—
sectorstringno—
tagsstringno—
colorstringno—
logo_urlstringno—
business_unit_idstringnopublic.business_units.id (the work-host business unit) this canvas belongs to. FK, ON DELETE CASCADE.
golden_circle_whyobjectno—
golden_circle_howobjectno—
golden_circle_whatobjectno—

archive_canvas_business_unit

Set strategy.business_units.is_archived on a row (default true — archive).write

Archive Canvas Business Unit

Set strategy.business_units.is_archived on a row (default true — archive). Pass archived: false to unarchive. This is a soft flag, not a delete — child block rows (value propositions, segments, etc.) are left untouched.

ParameterTypeRequiredDescription
idstringyesstrategy.business_units.id.
archivedbooleannoDefault: true.

The brand record of a business unit (strategy.brand_assets, one row per unit). tokens and assets are open JSON and a save replaces them. upsert_brand never writes the deprecated columns colors, primary_font and secondary_font, nor the unit colour and logo. derive_legacy is still accepted and is ignored.

The brand record of a business unit: tokens, assets, visibility and slug. List, read, save.

list_brands

List the brand records (strategy.brand_assets, one per business unit) with the unit name, slug, visibility, published_version, updated_at, has_tokens and has_assets.read

List Brands

List the brand records (strategy.brand_assets, one per business unit) with the unit name, slug, visibility, published_version, updated_at, has_tokens and has_assets. Use get_brand for the full row. Pass include_units_without_record: true to also get the business units that have NO brand record, flagged has_record: false (archived units are left out).

ParameterTypeRequiredDescription
visibilityenumnoOnly brands with this visibility. One of: public, members, private.
include_units_without_recordbooleannoAlso return business units that have no brand_assets row (has_record: false) Default: false.

get_brand

Fetch one brand record (strategy.brand_assets, all columns) by exactly one of: id, slug or business_unit_id.read

Get Brand

Fetch one brand record (strategy.brand_assets, all columns) by exactly one of: id, slug or business_unit_id. tokens and assets are open jsonb. colors, primary_font and secondary_font are deprecated and nothing writes them any more (they are being dropped); voice_and_tone stays and is written by the BM Canvas. A brand that does not exist is an error, not an empty result.

ParameterTypeRequiredDescription
idstringnostrategy.brand_assets.id.
slugstringnostrategy.brand_assets.slug.
business_unit_idstringnostrategy.business_units.id (one brand per unit)

upsert_brand

Create or update the brand record (strategy.brand_assets) of a business unit: inserts when the unit has none, updates otherwise, in one write.write

Upsert Brand

Create or update the brand record (strategy.brand_assets) of a business unit: inserts when the unit has none, updates otherwise, in one write. tokens and assets are open jsonb ({themes:{dark:{p,s,c},light},aliases} and {logos[],fonts[],ogImage,favicon}) and REPLACE the stored object (no deep merge: send the whole object); an omitted field is left untouched. Nothing else is written or derived: the deprecated columns colors, primary_font and secondary_font, and business_units.color / logo_url, are never touched. derive_legacy is DEPRECATED: it is still accepted so old callers do not break, but it is ignored and returns derive.status "skipped". Needs editor on the business unit or a global admin; a refusal is forbidden. Returns { success, action, brand, derive }.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
slugstringnoUnique URL slug; null clears.
tokensobjectnoREPLACES the stored tokens object.
assetsobjectnoREPLACES the stored assets object.
visibilityenumnoOne of: public, members, private.
taglinestringno—
brand_valuesobject | any[]no—
derive_legacybooleannoDEPRECATED, accepted and ignored. Nothing is derived or written to the legacy columns any more. Default: false.

get_brand_diff

Diff a brand record (strategy.brand_assets) against its published snapshots (strategy.brand_publications).read

Diff Brand

Diff a brand record (strategy.brand_assets) against its published snapshots (strategy.brand_publications). Find the brand by exactly one of id, slug or business_unit_id. With no version: the working record vs the latest published snapshot (empty {} and published_version null when nothing is published). With only to_version=n: version n-1 vs n (n=1 diffs against {}). With only from_version=n: version n vs the working record. With both: those two published versions. The snapshot has six keys: slug, tagline, brand_values, tokens, assets, visibility. Returns { from, to, empty, patch } where patch is an RFC 7396 merge patch (null when empty; arrays replace whole).

ParameterTypeRequiredDescription
idstringnostrategy.brand_assets.id.
slugstringnostrategy.brand_assets.slug.
business_unit_idstringnostrategy.business_units.id.
from_versionnumbernoPublished version to diff from.
to_versionnumbernoPublished version to diff to.

publish_brand

Publish the current brand record (strategy.brand_assets) as the next immutable version in strategy.brand_publications.write

Publish Brand

Publish the current brand record (strategy.brand_assets) as the next immutable version in strategy.brand_publications. Find the brand by exactly one of id, slug or business_unit_id. Optional change_reason. The database snapshots the record (slug, tagline, brand_values, tokens, assets, visibility) and sets brand_assets.published_version in one transaction. A record identical to the latest published version is refused: the result is { success: false, code: "EMPTY_DIFF", published_version } (not a thrown error). Needs editor on the business unit or a global admin; a refusal is forbidden. Opening PRs is not part of this tool. Returns { success, version, brand_id, slug, change_reason }.

ParameterTypeRequiredDescription
idstringnostrategy.brand_assets.id.
slugstringnostrategy.brand_assets.slug.
business_unit_idstringnostrategy.business_units.id.
change_reasonstringnoWhy this version is published.

Write one of the canvas blocks, for example value propositions or customer segments.

set_canvas_block

Upsert a row into one of the 10 canvas block tables (9 Business Model Canvas blocks + moat) for a business_unit: value_proposition, customer_segment, customer_relationship, channel, revenue_stream, key_partner…write

Set Canvas Block

Upsert a row into one of the 10 canvas block tables (9 Business Model Canvas blocks + moat) for a business_unit: value_proposition, customer_segment, customer_relationship, channel, revenue_stream, key_partner, key_activity, key_resource, expense_category, moat. Pass "id" to update an existing row (scoped to business_unit_id), or omit it to insert a new row. "fields" is passed through to the underlying table as-is — column names must match the table (e.g. value_proposition needs "name"; customer_relationship needs "name" + "type"; key_partner accepts free-text "name" + "description"; key_resource ("resources" table) accepts free-text "name" + "description" — both added 2026-07-15 via dfl-schema #683 to fix the "Unnamed Partner" display bug and let resources be modeled without a fixed entity/resource_category catalog FK). All blocks are agent-writable (RLS INSERT/UPDATE policies on every block table). moat ("moats" table) needs "name" + "moat_type" and is always written by the command service; prefer add_moat / update_moat / archive_moat. Business models: optional top-level "scope" ("shared" = in every business model of the canvas; "model" = owned by one model) and "business_model_id". scope "model" needs business_model_id; scope "shared" forbids it; business_model_id alone means scope "model". An insert without them stays shared (the DB default). scope / business_model_id inside "fields" must agree with the top-level args, else the call is refused. A model view = the shared items of the canvas + the items owned by that model (for customer segments, also the segments linked to the model). Same-canvas rule: the business model and the item must belong to the same business_unit_id; a model of another canvas is refused before any write. To change only the scope of an existing item, prefer set_item_scope. A write that RLS refuses returns forbidden.

ParameterTypeRequiredDescription
blockenumyesOne of: value_proposition, customer_segment, customer_relationship, channel, revenue_stream, key_partner, key_activity, key_resource, expense_category, moat.
business_unit_idstringyesstrategy.business_units.id this block row belongs to.
idstringnoRow id to update. Omit to insert a new row.
fieldsobjectnoColumn name → value for the target table. Default: {}.
scopeenumno"shared" (default on insert) or "model" (needs business_model_id) One of: shared, model.
business_model_idstringnostrategy.business_models.id that owns the item (scope "model"); must be of the same canvas.

The ways one canvas makes money, and which canvas items are shared by all of them or belong to one.

list_business_models

List the business models of one canvas (a strategy.business_units row), ordered by position, then name.read

List Business Models

List the business models of one canvas (a strategy.business_units row), ordered by position, then name. A business model is one way the canvas makes money; its status is current, hypothesis or retired. Each row adds item_counts (per canvas block, the items that the model owns: scope "model") and segment_link_count (the customer segments linked to the model with add_business_model_segment). A model view = the shared items of the canvas + the items owned by that model (for customer segments, also the segments linked to the model). Use it before set_item_scope, set_canvas_block with scope "model", or delete_business_model.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id (the canvas)
include_retiredbooleannoInclude models with status "retired" (default true) Default: true.

create_business_model

Create a business model in one canvas (a strategy.business_units row).write

Create Business Model

Create a business model in one canvas (a strategy.business_units row). A business model is one way the canvas makes money. The name must be unique in the canvas. status defaults to "hypothesis" (also: "current", "retired"). position orders the models (default 0). A new model owns no items: move items to it with set_item_scope, or create them with set_canvas_block scope "model". A model view = the shared items of the canvas + the items owned by that model (for customer segments, also the segments linked to the model). Needs editor on the business unit, or a global admin: a refused write returns forbidden.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id (the canvas)
namestringyesModel name, unique in the canvas.
descriptionstringno—
statusenumnoOne of: current, hypothesis, retired. Default: "hypothesis".
positionnumbernoSort order (default 0)

update_business_model

Partially update a business model: name, description, status (current, hypothesis, retired) or position.write

Update Business Model

Partially update a business model: name, description, status (current, hypothesis, retired) or position. Only the fields provided change. The update is scoped to business_unit_id: a model of another canvas is refused. To stop using a model that still owns items, set status "retired" instead of deleting it. Needs editor on the business unit, or a global admin: a refused write returns forbidden.

ParameterTypeRequiredDescription
idstringyesstrategy.business_models.id.
business_unit_idstringyesstrategy.business_units.id (the canvas of the model)
namestringno—
descriptionstringnonull clears the description.
statusenumnoOne of: current, hypothesis, retired.
positionnumberno—

delete_business_model

Hard-delete a business model of a canvas.write

Delete Business Model

Hard-delete a business model of a canvas. The delete is REFUSED, with nothing written, while the model still owns items in any canvas block (moat included); the refusal names the count per block. To continue, move the items to shared with set_item_scope (scope "shared"), or keep the model and set status "retired" with update_business_model. The customer-segment links of the model do not block: they are deleted with it, and the response says how many were removed. Scoped to business_unit_id: a model of another canvas is refused. Needs editor on the business unit, or a global admin: a refused write returns forbidden.

ParameterTypeRequiredDescription
idstringyesstrategy.business_models.id.
business_unit_idstringyesstrategy.business_units.id (the canvas of the model)

set_item_scope

Set who owns one canvas item (a row of one of the canvas block tables, moat included): scope "shared" (the item is in every business model of the canvas) or scope "model" with business_model_id (only that model owns it).write

Set Canvas Item Scope

Set who owns one canvas item (a row of one of the canvas block tables, moat included): scope "shared" (the item is in every business model of the canvas) or scope "model" with business_model_id (only that model owns it). scope "model" needs business_model_id; scope "shared" forbids it (the column is set to NULL). A model view = the shared items of the canvas + the items owned by that model (for customer segments, also the segments linked to the model). Same-canvas rule: the business model and the item must belong to the same business_unit_id; a model of another canvas is refused before any write. The update is scoped to item_id + business_unit_id. Use it to move items to shared before delete_business_model. Needs editor on the business unit, or a global admin: a refused write returns forbidden.

ParameterTypeRequiredDescription
blockenumyesOne of: value_proposition, customer_segment, customer_relationship, channel, revenue_stream, key_partner, key_activity, key_resource, expense_category, moat.
business_unit_idstringyesstrategy.business_units.id (the canvas of the item)
item_idstringyesRow id in the block table.
scopeenumyesOne of: shared, model.
business_model_idstringnoRequired when scope is "model"; forbidden when scope is "shared".

add_business_model_segment

Link a customer segment to a business model: the model SERVES the segment.write

Link Customer Segment to Business Model

Link a customer segment to a business model: the model SERVES the segment. One segment can be linked to many models. A linked segment appears in the model view (list_customer_segments with business_model_id). This is not ownership: to make a segment belong to one model, use set_item_scope. Same-canvas rule: the business model and the item must belong to the same business_unit_id; a model of another canvas is refused before any write. (both the model and the segment). Idempotent: an existing link returns already_linked: true and writes nothing. Needs editor on the business unit, or a global admin.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id (the canvas of the model and the segment)
business_model_idstringyesstrategy.business_models.id.
customer_segment_idstringyesstrategy.customer_segments.id.

remove_business_model_segment

Remove the link between a customer segment and a business model (the model no longer serves the segment).write

Unlink Customer Segment from Business Model

Remove the link between a customer segment and a business model (the model no longer serves the segment). The segment itself stays. Same-canvas rule: the business model and the item must belong to the same business_unit_id; a model of another canvas is refused before any write. (both the model and the segment). Idempotent: a missing link returns removed: 0. Needs editor on the business unit, or a global admin: a refused write returns forbidden.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id (the canvas of the model and the segment)
business_model_idstringyesstrategy.business_models.id.
customer_segment_idstringyesstrategy.customer_segments.id.

The 3 or so stable themes of a business unit, and the head keywords of each. Pautas point at a pillar.

list_content_pillars

List the content pillars of one business unit (strategy.content_pillars), ordered by position, then name.read

List Content Pillars

List the content pillars of one business unit (strategy.content_pillars), ordered by position, then name. Each pillar carries its linked head keywords (keyword_id, text, is_primary, cluster_name) when include_keywords is true. status filters active, retired or all (default all). Use the pillar id as content_pillar_ext_id when you create or filter pautas. Pillars are the stable themes of a business unit (about 3 per BU, evergreen). A pauta points at a pillar by content_pillar_ext_id (an external reference, no foreign key). A pillar is never deleted to stop using it: set status "retired", so the pautas that point at it keep a name. Read-only.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id (the canvas)
statusenumnoDefault all. One of: active, retired, all. Default: "all".
include_keywordsbooleannoAdd the linked keywords to each pillar (default true) Default: true.

upsert_content_pillar

Create a content pillar (no id) or update one (with id) in one business unit (strategy.content_pillars).write

Create or Update Content Pillar

Create a content pillar (no id) or update one (with id) in one business unit (strategy.content_pillars). On create, name is required; status defaults to "active" and position to 0. On update, only the fields you pass change; null clears description, customer_segment_id, value_proposition_id and business_model_id. The name is unique in the business unit. customer_segment_id, value_proposition_id and business_model_id must be in the same business unit (a row of another canvas is refused before any write). scope "shared" belongs to every business model; scope "model" needs business_model_id. To stop using a pillar, pass status "retired": a pillar is not deleted, because pautas point at it. Pillars are the stable themes of a business unit (about 3 per BU, evergreen). A pauta points at a pillar by content_pillar_ext_id (an external reference, no foreign key). A pillar is never deleted to stop using it: set status "retired", so the pautas that point at it keep a name. Needs editor on the business unit, or a global admin: a refused write returns forbidden.

ParameterTypeRequiredDescription
idstringnostrategy.content_pillars.id. Omit to create.
business_unit_idstringyesstrategy.business_units.id (the canvas of the pillar)
namestringnoPillar name, unique in the business unit. Required on create.
descriptionstringnoWhat the pillar covers and why it stays true for 12+ months. null clears.
statusenumnoactive (default on create) or retired. One of: active, retired.
positionnumbernoSort order (default 0)
customer_segment_idstringnostrategy.customer_segments.id of the same canvas. null clears.
value_proposition_idstringnostrategy.value_propositions.id of the same canvas. null clears.
scopeenumno"shared" or "model" (needs business_model_id) One of: shared, model.
business_model_idstringnostrategy.business_models.id that owns the pillar (scope "model"). null = shared.

set_content_pillar_keywords

Link keywords to a content pillar (strategy.content_pillar_keywords).write

Set Content Pillar Keywords

Link keywords to a content pillar (strategy.content_pillar_keywords). mode "replace" (default) makes keyword_ids the whole set of the pillar; "add" links the ids and keeps the rest; "remove" unlinks the ids. Linking the same keyword twice is a no-op. primary_keyword_id marks the main keyword of the pillar (it must be linked after the call; null clears the primary). Every id is checked before any write: an id that does not exist, is in another business unit, or is a child keyword (the answer names its head keyword) refuses the whole call and nothing is written. A pillar links to HEAD keywords only (strategy.keywords with parent_keyword_id empty); the children of a head follow it. Each keyword must be in the same business unit as the pillar. At most one linked keyword is primary. Needs editor on the business unit, or a global admin: a refused write returns forbidden.

ParameterTypeRequiredDescription
content_pillar_idstringyesstrategy.content_pillars.id.
keyword_idsstring[]yesstrategy.keywords.id of HEAD keywords. With mode "replace", [] unlinks all.
modeenumnoOne of: replace, add, remove. Default: "replace".
primary_keyword_idstringnoThe main keyword of the pillar; must be linked. null clears the primary. Omit to keep it.

delete_content_pillar

Delete one RETIRED content pillar for good (strategy.content_pillars), with its keyword links (they cascade).write

Delete Content Pillar

Delete one RETIRED content pillar for good (strategy.content_pillars), with its keyword links (they cascade). Hard delete, no recovery: to stop using a pillar, retire it with upsert_content_pillar status "retired" instead. Refused before any write when the pillar is still active (retire it first), when confirm_name is not the exact current name, and when a pauta still points at it (content_pillar_ext_id; clear or move those pautas first). If the pautas table cannot be read from here, the pauta check is skipped and the answer says pauta_check "skipped". Meant for test data and for a pillar that never got a pauta. Needs editor on the business unit, or a global admin.

ParameterTypeRequiredDescription
idstringyesstrategy.content_pillars.id.
business_unit_idstringyesstrategy.business_units.id (the canvas of the pillar)
confirm_namestringyesThe exact current name of the pillar, as list_content_pillars shows it.

Link two business units, for example one feeds or sells to the other.

add_canvas_business_unit_relationship

Create a typed edge in strategy.business_unit_relationships between two business units (from_bu → to_bu), e.g. "the Fellowship BU funds the Studio BU" or "Itera commercializes Revera's methodology".write

Add Canvas Business Unit Relationship

Create a typed edge in strategy.business_unit_relationships between two business units (from_bu → to_bu), e.g. "the Fellowship BU funds the Studio BU" or "Itera commercializes Revera's methodology". mechanics is free-form jsonb describing how the relationship actually works (revenue split, staffing %, etc).

ParameterTypeRequiredDescription
from_bustringyesstrategy.business_units.id — the source of the relationship.
to_bustringyesstrategy.business_units.id — the target of the relationship (must differ from from_bu)
relationship_typeenumyesOne of: funds, supplies_talent, commercializes, provides_methodology, shares_brand, incubates.
mechanicsobjectnoDefault: {}.
descriptionstringno—
is_activebooleannoDefault: true.
started_atstringnoISO date the relationship started.

Record a belief the strategy depends on, so it can be tested.

add_assumption

Create a strategy.assumptions row for a business_unit — a testable belief underpinning the strategy (desirability/viability/feasibility), its status, evidence gathered so far, and the risk if it turns out to be wrong.write

Add Assumption

Create a strategy.assumptions row for a business_unit — a testable belief underpinning the strategy (desirability/viability/feasibility), its status, evidence gathered so far, and the risk if it turns out to be wrong.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
statementstringyesThe assumption, stated as a testable claim.
categoryenumyesOne of: desirability, viability, feasibility.
statusenumnoOne of: untested, testing, validated, invalidated. Default: "untested".
evidenceobject[]noDefault: [].
risk_if_wrongstringno—

The Moat block (unfair advantage) of the canvas, in strategy.moats. The reads use your login. Every write goes to the canvas block commands of dfl-domain-api with your token. A moat with no strength is not rated. Archive hides a moat; it never deletes it.

Record the unfair advantages of a business unit: why they are hard to copy and what could erode them.

list_moats

List strategy.moats rows (the Moat block: unfair advantages) of a business_unit_id, oldest first.read

List Moats

List strategy.moats rows (the Moat block: unfair advantages) of a business_unit_id, oldest first. Archived moats are hidden unless include_archived is true. strength null means NOT RATED (not "weak"). Pass business_model_id to get the model view: the shared moats + the moats owned by that model. The model must belong to the same canvas, else the call is refused.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
include_archivedbooleannoDefault: false.
business_model_idstringnoReturn the view of this business model only (same canvas)

add_moat

Create a strategy.moats row for a business_unit: an unfair advantage, why a competitor cannot copy it fast, the evidence for it and what could erode it.write

Add Moat

Create a strategy.moats row for a business_unit: an unfair advantage, why a competitor cannot copy it fast, the evidence for it and what could erode it. status defaults to "hypothesis". Omit strength when it is not rated. assumption_id names the assumption to test; it must be of the same business unit. scope "model" needs business_model_id; the default is "shared". Same-canvas rule: the business model and the item must belong to the same business_unit_id; a model of another canvas is refused before any write. Needs editor on the business unit.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
namestringyes—
moat_typeenumyesOne of: network_effects, proprietary_data, switching_costs, brand, scale_economies, regulation, cornered_resource, process_power, counter_positioning, other.
descriptionstringno—
strengthenumnoOmit when not rated. One of: weak, moderate, strong.
statusenumnoDefault "hypothesis". One of: hypothesis, building, proven, eroding.
evidenceobject[]noItems {text, url?, source_id?}.
why_defensiblestringnoWhy a competitor cannot copy it fast.
erosion_risksstringnoWhat could break it.
assumption_idstringnostrategy.assumptions.id (same business unit)
scopeenumnoOne of: shared, model.
business_model_idstringnostrategy.business_models.id that owns the moat (scope "model")

update_moat

Partially update a strategy.moats row by id + business_unit_id.write

Update Moat

Partially update a strategy.moats row by id + business_unit_id. Only the fields provided are changed; null clears a nullable field (strength null = not rated). evidence REPLACES the whole list. assumption_id must be of the same business unit. scope "model" needs business_model_id; scope "shared" forbids it. Same-canvas rule: the business model and the item must belong to the same business_unit_id; a model of another canvas is refused before any write. To archive or unarchive use archive_moat. Needs editor on the business unit.

ParameterTypeRequiredDescription
idstringyesstrategy.moats.id.
business_unit_idstringyesstrategy.business_units.id of the moat.
namestringno—
moat_typeenumnoOne of: network_effects, proprietary_data, switching_costs, brand, scale_economies, regulation, cornered_resource, process_power, counter_positioning, other.
descriptionstringno—
strengthenumnoOne of: weak, moderate, strong.
statusenumnoOne of: hypothesis, building, proven, eroding.
evidenceobject[]noItems {text, url?, source_id?}.
why_defensiblestringno—
erosion_risksstringno—
assumption_idstringnostrategy.assumptions.id (same business unit)
scopeenumnoOne of: shared, model.
business_model_idstringnostrategy.business_models.id that owns the moat.

archive_moat

Archive (default) or unarchive one strategy.moats row.write

Archive Moat

Archive (default) or unarchive one strategy.moats row. Archive sets archived_at to now and archived_reason to reason; archived=false sets both to null. The row is never deleted. An archived moat is hidden by list_moats unless include_archived is true. Needs editor on the business unit.

ParameterTypeRequiredDescription
idstringyesstrategy.moats.id.
business_unit_idstringyesstrategy.business_units.id of the moat.
archivedbooleannofalse = unarchive. Default: true.
reasonstringnoWhy it is archived (ignored when archived is false)

Say where a strategy item came from: a call, a plan, a document.

add_source

Create a strategy.sources row — a provenance record for where a strategy artifact came from (a Fireflies call, a plans.devfellowship.com plan, a Company Brain node, or a manual note), or of a keyword-metrics collection…write

Add Source

Create a strategy.sources row — a provenance record for where a strategy artifact came from (a Fireflies call, a plans.devfellowship.com plan, a Company Brain node, or a manual note), or of a keyword-metrics collection (api_run = one provider API run, browser_agent_session = one browser-agent session; pass its id as source_id to upsert_keywords / update_keyword_metrics), or a web page (web_page: external_ref = the url, occurred_at = when it was read, summary = its title, kind = pricing, docs, review, news, ads, landing, post or other). Use with link_artifact_source to attach it to the artifact it backs; for a competitor company, add_entity_source does both steps. A source is immutable: delete and add it again to fix it.

ParameterTypeRequiredDescription
source_typeenumyesOne of: fireflies_call, plans_app, company_brain, manual, api_run, browser_agent_session, web_page.
external_refstringnoExternal id/URL for the source (call id, plan slug, brain node id, ...)
occurred_atstringnoISO timestamp the source event occurred.
summarystringno—
kindenumnoKind of a web_page source. One of: pricing, docs, review, news, other, ads, landing, post.
Create a strategy.artifact_sources row linking any strategy artifact row (by table name + id, e.g. artifact_table: "assumptions") to a strategy.sources row created via add_source.write

Link Artifact Source

Create a strategy.artifact_sources row linking any strategy artifact row (by table name + id, e.g. artifact_table: "assumptions") to a strategy.sources row created via add_source. This is how provenance ("this assumption came from the 2026-07-10 strategic call") gets recorded without a dedicated source_id column on every block table. For a competitor company use artifact_table "entities" with artifact_id = the strategy.entities.id (add_entity_source does it in one call).

ParameterTypeRequiredDescription
artifact_tablestringyesThe strategy.* table the artifact lives in, e.g. "assumptions", "value_propositions", "entities".
artifact_idstringyesThe artifact row id in artifact_table.
source_idstringyesstrategy.sources.id (from add_source)
extraction_notestringnoHow/why this source backs this artifact.

Save the whole canvas of a business unit at one point in time.

create_canvas_snapshot

Save the Business Model Canvas of a business unit as a version (status=draft).write

Create Canvas Snapshot

Save the Business Model Canvas of a business unit as a version (status=draft). There is one version per business unit per business day (America/Sao_Paulo). The first save of a day creates the version. A later save on the same day UPDATES that day's version when the canvas changed. When nothing changed since the latest version, the call writes nothing and returns skipped=true. The nightly job follows the same rule. The result has outcome = created, updated or unchanged. The generated diff summary is stored with the version; note_md is your own human note (it is dropped when nothing changed). Runs with your own login: you must be an editor of the business unit, or the call is refused. A version cannot be deleted, so do not create test snapshots on real business units.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id to snapshot.
triggerenumnoOne of: manual, weekly_synthesis, pre_deck_export, post_strategic_call. Default: "manual".
note_mdstringnoOptional human note stored with this version (separate from the generated diff summary)

list_canvas_snapshots

List the strategy.canvas_snapshots of one business_unit, newest first (snapshot_version DESC).read

List Canvas Snapshots

List the strategy.canvas_snapshots of one business_unit, newest first (snapshot_version DESC). Rows carry metadata only (version, status, trigger, summary, dates) — never the snapshot content or the diff_json; has_diff_json tells whether a diff exists. Use get_canvas_snapshot for the content. There is no ratified version: the canvas is versioned once per day when it changed (status is a legacy column; every row is draft).

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
limitnumbernoDefault: 50.

get_canvas_snapshot

Get one strategy.canvas_snapshots row.read

Get Canvas Snapshot

Get one strategy.canvas_snapshots row. Address it ONE way: snapshot_id, OR business_unit_id plus exactly one of version (int) / which ("latest" = highest version). include_snapshot=false drops the large snapshot and diff_json. blocks (e.g. ["customer_segment","value_proposition"]) keeps only those keys of snapshot.blocks; unknown keys are listed in ignored_blocks. Use list_canvas_snapshots to find versions. There is no ratified version: the canvas is versioned once per day when it changed.

ParameterTypeRequiredDescription
snapshot_idstringnostrategy.canvas_snapshots.id.
business_unit_idstringnostrategy.business_units.id (with version or which)
versionnumbernosnapshot_version.
whichenumnoOne of: latest.
include_snapshotbooleannoDefault: true.
blocksstring[]noBlock keys to keep in snapshot.blocks.

get_item_history

Read the change history of ONE strategy item (a canvas block row, persona, competitor, goal, KPI, ...) from strategy.<table>_history, newest first.read

Get Item History

Read the change history of ONE strategy item (a canvas block row, persona, competitor, goal, KPI, ...) from strategy.<table>_history, newest first. Each history row is the item AS IT WAS BEFORE the change, with operation (UPDATE or DELETE), changed_by and changed_at. current is the live row, or null when the item was deleted (or is not visible to you). Read-only; there is no restore. Needs membership (RLS). The tables entity_pricing_plans, entity_events, competitor_ratings, competitor_ads, customer_insights and entity_channels have no _history twin: their history comes from public.activity_logs (source "activity_logs"), each row with operation, changed_by, changed_at, old and new.

ParameterTypeRequiredDescription
tableenumyesThe strategy base table of the item, e.g. customer_segments. One of: assumptions, brand_assets, business_models, business_unit_relationships, business_units, channels, competitors, customer_relationships, customer_segments, empathy_maps, expense_categories, goals, key_activities, key_partners, kpis, moats, personas, resources, revenue_streams, strategic_dimensions, strategic_narratives, value_propositions, writing_patterns, entity_pricing_plans, entity_events, competitor_ratings, competitor_ads, customer_insights, entity_channels.
item_idstringyesThe id of the item in that table.
limitnumbernoDefault: 50.

list_deleted_items

List the strategy items that were DELETED from one business_unit, newest first, from the strategy.<table>_history rows with operation = DELETE.read

List Deleted Items

List the strategy items that were DELETED from one business_unit, newest first, from the strategy.<table>_history rows with operation = DELETE. Each item carries its last state (snapshot), deleted_at and deleted_by. block limits the list to one canvas block (moat included); without it every business-unit table is read (blocks, personas, empathy maps, competitors, goals, KPIs, moats, ...). Read-only; there is no restore. Needs membership (RLS).

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
blockenumnoOnly this canvas block. One of: value_proposition, customer_segment, customer_relationship, channel, revenue_stream, key_partner, key_activity, key_resource, expense_category, moat.
limitnumbernoDefault: 100.

get_canvas_snapshot_diff

Structured diff between two versions of one business unit's canvas: per section (the 9 blocks, moats, personas, competitors, goals, KPIs, ...) the items added, removed and changed, field by field (items match by id).read

Diff Canvas Snapshots

Structured diff between two versions of one business unit's canvas: per section (the 9 blocks, moats, personas, competitors, goals, KPIs, ...) the items added, removed and changed, field by field (items match by id). A ref is a version number, a snapshot uuid, latest, or — only for to — current (the live canvas, built now). Defaults: to = latest; from = the version just below to. Returns { from, to, diff, summary_md }. Read-only; computed by the dfl-strategy-snapshots service with your own login (RLS).

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
fromstringnoBase version (not current)
tostringnoTarget version; default latest.

Competitors, personas and customer segments

Section titled “Competitors, personas and customer segments”

Who the competitors and the buyers are: competitors, personas and customer segments.

add_competitor

Create a strategy.competitors row for a business_unit.write

Add Competitor

Create a strategy.competitors row for a business_unit. Competitors point at a strategy.entities row (the actual company name/website/logo lives on entities, not on competitors itself, so entities can be shared across the competitor/key_partner graph). Pass entity_id to link an existing entity, or entity_name (+ optional entity_description/ entity_website) to create a new one inline. The per-business-unit facts (slug, business model, audience, regions, company status, is_reference) are optional. Without slug the tool derives it from the entity name (kebab-case, accents removed; competitor-<8 hex> when the name gives nothing) and adds -2, -3 when the business unit already uses it. A rename of the entity later never changes the slug. Needs editor on the business unit, or a global admin: a refused write returns forbidden (naming the business unit).

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id this competitor is tracked against.
entity_idstringnoExisting strategy.entities.id — omit if creating a new entity inline.
entity_namestringnoName for a new entity (required if entity_id is omitted)
entity_descriptionstringno—
entity_websitestringno—
market_sharenumberno—
threat_levelenumnoOne of: high, medium, low.
visiblebooleannoDefault: true.
slugstringnoURL slug inside the business unit (kebab-case, ≤80). Default on add: kebab-case of the entity name, with -2, -3 on a collision.
business_modelenumnoPrimary business model archetype. One of: saas_per_seat, saas_per_usage, freemium, open_source_paid_cloud, marketplace, b2c_subscription, enterprise_quote, template_generic_tool.
business_model_secondaryenumnoOptional secondary archetype; needs business_model and must differ from it. One of: saas_per_seat, saas_per_usage, freemium, open_source_paid_cloud, marketplace, b2c_subscription, enterprise_quote, template_generic_tool.
audience_typeenumnoOne of: b2b, b2c, both.
audience_sizesenum[]noSubset of solo, smb, enterprise (replaces the list)
regionsenum[]noSubset of brazil, latam, us, europe, global (replaces the list)
company_statusenumnoDefault active. Dated history: add_entity_event. One of: active, acquired, feature_discontinued, closed, renamed_absorbed.
acquired_bystringnoOnly with company_status acquired or renamed_absorbed.
acquired_onstringnoYYYY-MM-DD. Only with company_status acquired or renamed_absorbed.
is_referencebooleannotrue = the DFL own-product row of the business unit (at most one)

list_competitors

List the strategy.competitors of one business unit, each with its strategy.entities row (company name, website, logo, strengths, weaknesses), its notes/screenshots and its structured fields (slug, business_model…read

List Competitors

List the strategy.competitors of one business unit, each with its strategy.entities row (company name, website, logo, strengths, weaknesses), its notes/screenshots and its structured fields (slug, business_model, business_model_secondary, audience_type, audience_sizes, regions, company_status, acquired_by, acquired_on, is_reference). Archived competitors (visible = false) are left out unless include_archived is true. For the scores per strategic dimension, use list_competitor_scores. Read-only.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id (from list_canvas_business_units)
include_archivedbooleannoAlso return competitors hidden with archive_competitor (visible = false) Default: false.
limitnumbernoDefault: 100.

get_competitor

Read one strategy.competitors row, by id or by {business_unit_id, slug}, with its entity (company name, website, logo, strengths, weaknesses), notes, screenshots, the structured fields (slug, business model, audience…read

Get Competitor

Read one strategy.competitors row, by id or by {business_unit_id, slug}, with its entity (company name, website, logo, strengths, weaknesses), notes, screenshots, the structured fields (slug, business model, audience, regions, company status, is_reference), and its score on every strategic dimension of its business unit (score null = not scored) plus the weighted score the BM Canvas Comparison Matrix shows (hidden dimensions are left out unless include_hidden is true). Also returns the facts of the company, shared by every business unit that tracks it: pricing_plans, lowest_paid_plans (per currency), sources and events. Read-only.

ParameterTypeRequiredDescription
idstringnostrategy.competitors.id.
business_unit_idstringnoWith slug: the business unit of the competitor.
slugstringnoWith business_unit_id: the competitor slug inside the business unit.
include_hiddenbooleannoAlso score the hidden dimensions (visible = false) Default: false.

update_competitor

Partially update a competitor.write

Update Competitor

Partially update a competitor. Only the fields you pass change. Competitor fields (market_share, threat_level, visible, notes, screenshots) are per business unit. entity_* fields edit the shared strategy.entities row (the company itself), so they change it for every business unit that tracks the same company; when the competitor has no entity yet, entity_name creates one and links it. screenshots REPLACES the whole list. Needs editor on the competitor business unit, or a global admin: a refused write returns forbidden (naming the business unit). pending_schema is only for a column that does not exist yet. Structured fields (slug, business_model, business_model_secondary, audience_type, audience_sizes, regions, company_status, acquired_by, acquired_on, is_reference) are per business unit; pass null to clear a nullable one. A slug already used in the business unit is refused; a rename of the entity never changes the slug. Each screenshot screen_type must be a base type or a type of the business unit (list_screen_types), and strategic_dimension_id a dimension of the business unit. To patch one screenshot, use update_competitor_screenshot.

ParameterTypeRequiredDescription
idstringyesstrategy.competitors.id.
market_sharenumbernoPercent, 0–100.
threat_levelenumnoOne of: high, medium, low.
visiblebooleannofalse hides it from the matrix (same as archive_competitor)
notesstringnoCompetitive analysis of this competitor, markdown allowed.
screenshotsobject[]noReplaces the whole list.
entity_namestringno—
entity_descriptionstringno—
entity_websitestringno—
entity_logo_urlstringno—
entity_strengthsstring[]noReplaces the list.
entity_weaknessesstring[]noReplaces the list.
slugstringnoNew URL slug inside the business unit (kebab-case, ≤80). Must be free in the business unit.
business_modelenumnoOne of: saas_per_seat, saas_per_usage, freemium, open_source_paid_cloud, marketplace, b2c_subscription, enterprise_quote, template_generic_tool.
business_model_secondaryenumnoOne of: saas_per_seat, saas_per_usage, freemium, open_source_paid_cloud, marketplace, b2c_subscription, enterprise_quote, template_generic_tool.
audience_typeenumnoOne of: b2b, b2c, both.
audience_sizesenum[]noSubset of solo, smb, enterprise (replaces the list)
regionsenum[]noSubset of brazil, latam, us, europe, global (replaces the list)
company_statusenumnoDefault active. Dated history: add_entity_event. One of: active, acquired, feature_discontinued, closed, renamed_absorbed.
acquired_bystringnoOnly with company_status acquired or renamed_absorbed; null clears.
acquired_onstringnoYYYY-MM-DD; only with company_status acquired or renamed_absorbed; null clears.
is_referencebooleannotrue = the DFL own-product row of the business unit (at most one)

archive_competitor

Hide a competitor (soft delete): sets strategy.competitors.visible = false, which removes it from the BM Canvas Comparison Matrix and from list_competitors.write

Archive Competitor

Hide a competitor (soft delete): sets strategy.competitors.visible = false, which removes it from the BM Canvas Comparison Matrix and from list_competitors. Its scores and history stay. Pass archived: false to show it again. There is no hard delete: the table has no DELETE policy, and a delete would also erase every score of the competitor.

ParameterTypeRequiredDescription
idstringyesstrategy.competitors.id.
archivedbooleannotrue = hide (default), false = show again. Default: true.

set_competitor_business_unit

Move a competitor to another business unit.write

Set Competitor Business Unit (move a competitor)

Move a competitor to another business unit. The same competitor row moves (id, entity, notes, screenshots, visible, threat level and history stay). By default (move_dimensions: false) ONLY the competitor moves: each score is re-pointed to the target dimension with the same template, and a score with no matching target dimension is DROPPED (listed in ratings_without_target / ratings_dropped). move_dimensions: true creates the missing target dimensions with the source weight instead (on_unmapped then decides for a score with no template). Screenshot strategic_dimension_ids are re-mapped by template, else cleared. A slug already used in the target gets -2, -3. Pricing, sources and events belong to the company and do not move. dry_run defaults to TRUE: it writes nothing and returns the planned diff. It refuses when two scores would land on one dimension, or when the target business unit already has this competitor (same entity or same name; allow_duplicate: true overrides). The writes run in order with compensation (no transaction): if the competitor update fails, the scores go back.

ParameterTypeRequiredDescription
competitor_idstringyesstrategy.competitors.id (from list_competitors)
target_business_unit_idstringyesstrategy.business_units.id to move the competitor to.
dry_runbooleannotrue (default) = write nothing, return the planned diff. Default: true.
on_unmappedenumnoA score whose dimension has no template: "refuse" (default) = write nothing; "drop" = delete those scores after the move. One of: refuse, drop. Default: "refuse".
allow_duplicatebooleannoMove even when the target business unit already has a competitor with the same entity or name. Default: false.
move_dimensionsbooleannofalse (default) = move only the competitor, drop scores with no matching target dimension; true = create the missing target dimensions. Default: false.

update_competitor_screenshot

Patch ONE screenshot of a competitor, matched by its url.write

Update Competitor Screenshot

Patch ONE screenshot of a competitor, matched by its url. Only the fields you pass change; null removes a field from the item. screen_type must be a base type or a type of the business unit (list_screen_types); strategic_dimension_id must be a dimension of the competitor business unit; source_url must be http(s). The other screenshots stay as they are. Needs editor on the competitor business unit, or a global admin: a refused write returns forbidden (naming the business unit).

ParameterTypeRequiredDescription
competitor_idstringyesstrategy.competitors.id.
urlstringyesThe url of the screenshot item to patch (exact match)
captionstringno—
captured_atstringnoISO date-time of the capture.
screen_typestringnoA base type or a key of the business unit (list_screen_types)
is_outdatedbooleanno—
is_marketingbooleanno—
source_urlstringno—
strategic_dimension_idstringno—

set_competitor_tags

Write the tags of one competitor (strategy.competitors.tags; list_competitors and get_competitor return them).write

Set Competitor Tags

Write the tags of one competitor (strategy.competitors.tags; list_competitors and get_competitor return them). Pass tags to REPLACE the whole list (an empty list clears it), or add and/or remove to change it in place. tags together with add/remove is refused, and so is the same tag in add and remove. Each tag is lowercase kebab-case (a-z, 0-9, "-"), at most 40 characters; at most 30 tags. Duplicates are removed (the first one stays, order is kept). Removing a tag that is not on the list is ignored. The tags are per business unit. Needs editor on the competitor business unit, or a global admin: a refused write returns forbidden (naming the business unit). Returns the competitor id and the final tags list.

ParameterTypeRequiredDescription
idstringyesstrategy.competitors.id.
tagsstring[]noReplaces the whole list. [] clears it. Not with add/remove.
addstring[]noTags to append (kept in order; a tag already on the list is not repeated)
removestring[]noTags to take off the list.

add_persona

Create a strategy.personas row under a customer_segment — a named buyer/user persona (occupation, buying role in the deal, ICP priority tier).write

Add Persona

Create a strategy.personas row under a customer_segment — a named buyer/user persona (occupation, buying role in the deal, ICP priority tier).

ParameterTypeRequiredDescription
customer_segment_idstringyesstrategy.customer_segments.id this persona belongs to.
namestringyes—
occupationstringno—
descriptionstringno—
imagestringnoImage URL.
sort_ordernumbernoDefault: 0.
buying_roleenumnoOne of: economic_buyer, champion, user, influencer, gatekeeper, blocker.
icp_priorityenumnoOne of: primary, secondary, tertiary.

list_personas

List strategy.personas rows.read

List Personas

List strategy.personas rows. Pass exactly one filter: customer_segment_id (direct — personas belonging to one segment) or business_unit_id (joins through customer_segments to return every persona across all of that BU's segments).

ParameterTypeRequiredDescription
customer_segment_idstringnostrategy.customer_segments.id — direct filter.
business_unit_idstringnostrategy.business_units.id — filters personas across every segment of this BU (joins via customer_segments)
limitnumbernoDefault: 50.

update_persona

Partially update a strategy.personas row by id.write

Update Persona

Partially update a strategy.personas row by id. Only the fields provided are changed.

ParameterTypeRequiredDescription
idstringyesstrategy.personas.id.
customer_segment_idstringnoRe-parent the persona to a different customer_segment_id.
namestringno—
occupationstringno—
descriptionstringno—
imagestringnoImage URL.
sort_ordernumberno—
buying_roleenumnoOne of: economic_buyer, champion, user, influencer, gatekeeper, blocker.
icp_priorityenumnoOne of: primary, secondary, tertiary.

delete_persona

Hard-delete a strategy.personas row by id.write

Delete Persona

Hard-delete a strategy.personas row by id. strategy.personas has no soft-delete/archive flag today, so this is a permanent row delete — use for cleaning up misparented/duplicate personas (e.g. seeded under the wrong customer_segment).

ParameterTypeRequiredDescription
idstringyesstrategy.personas.id.

add_customer_segment

Create one strategy.customer_segments row (the Customer Segments block) in a business unit canvas.write

Add Customer Segment

Create one strategy.customer_segments row (the Customer Segments block) in a business unit canvas. Needs editor on the business unit. name is required; the other fields are optional. needs and pain_points take a list of strings. age_range is one of strategy.age_range_enum (0_12, 13_17, 18_24, 25_34, 35_44, 45_54, 55_64, 65_plus). scope + business_model_id set who OWNS the segment: "shared" (default; every business model of the canvas) or "model" (one model; needs business_model_id). scope "shared" forbids business_model_id; business_model_id alone means scope "model". Same-canvas rule: the business model and the item must belong to the same business_unit_id; a model of another canvas is refused before any write. To say that a model SERVES a segment without owning it, use add_business_model_segment. To change a segment use update_customer_segment.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id of the canvas that gets the segment.
namestringyes—
descriptionstringno—
demographicsstringno—
age_rangestringnoOne of strategy.age_range_enum.
needsstring[] | objectnoList of strings.
pain_pointsstring[] | objectnoList of strings.
persona_namestringnoLegacy inline-persona field (prefer add_persona)
persona_descriptionstringno—
persona_occupationstringno—
persona_imagestringno—
scopeenumno"shared" (default) or "model" (needs business_model_id) One of: shared, model.
business_model_idstringnostrategy.business_models.id that owns the segment (scope "model"); same canvas.

list_customer_segments

List strategy.customer_segments rows for a business_unit_id.read

List Customer Segments

List strategy.customer_segments rows for a business_unit_id. Each row carries scope ("shared" or "model"), business_model_id (the model that OWNS the segment, when scope is "model") and linked_business_model_ids (the models that SERVE the segment, see add_business_model_segment). Pass business_model_id to get the model view: the shared segments + the segments owned by the model + the segments linked to the model. A model view = the shared items of the canvas + the items owned by that model (for customer segments, also the segments linked to the model). The model must belong to the same canvas, else the call is refused.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id this segment belongs to.
business_model_idstringnoReturn the view of this business model only (same canvas)
limitnumbernoDefault: 50.

update_customer_segment

Partially update a strategy.customer_segments row by id.write

Update Customer Segment

Partially update a strategy.customer_segments row by id. Only the fields provided are changed. scope + business_model_id set who OWNS the segment: "shared" (every business model of the canvas) or "model" (one model; needs business_model_id). scope "shared" forbids business_model_id (it is set to NULL); business_model_id alone means scope "model". Same-canvas rule: the business model and the item must belong to the same business_unit_id; a model of another canvas is refused before any write. To say that a model SERVES a segment without owning it, use add_business_model_segment.

ParameterTypeRequiredDescription
idstringyesstrategy.customer_segments.id.
business_unit_idstringnoRe-parent the segment to a different business_unit_id.
namestringno—
descriptionstringno—
demographicsstringno—
needsstring[] | objectnoList of strings.
pain_pointsstring[] | objectnoList of strings.
age_rangestringnoOne of strategy.age_range_enum.
persona_namestringnoLegacy inline-persona field (superseded by strategy.personas rows — prefer add_persona/update_persona)
persona_descriptionstringno—
persona_occupationstringno—
persona_imagestringno—
scopeenumno"shared" or "model" (needs business_model_id) One of: shared, model.
business_model_idstringnostrategy.business_models.id that owns the segment (scope "model"); same canvas.

delete_customer_segment

Hard-delete a strategy.customer_segments row by id.write

Delete Customer Segment

Hard-delete a strategy.customer_segments row by id. CAUTION: as of 2026-07-15, strategy.customer_segments has INSERT/UPDATE/SELECT RLS policies for authenticated members but NO DELETE policy — this call will likely fail with a Postgres RLS error (0 rows deleted, or 42501) until a dfl-schema migration adds one. If it fails for that reason, do not silently swallow it — surface it and flag a dfl-schema follow-up. Also note personas FK-reference customer_segment_id with no documented ON DELETE behavior — delete/re-parent child personas first.

ParameterTypeRequiredDescription
idstringyesstrategy.customer_segments.id.

Competitor analysis (dimensions and scores)

Section titled “Competitor analysis (dimensions and scores)”

The weighted criteria competitors are scored on, and the scores behind the BM Canvas Comparison Matrix and Chart.

list_strategic_dimensions

List the strategic dimensions (the weighted criteria competitors are scored on) of one business unit.read

List Strategic Dimensions

List the strategic dimensions (the weighted criteria competitors are scored on) of one business unit. Each row has its name and description (from its template), weight, and shown_in_bm_canvas (false when the template has no industry — the BM Canvas then hides it). These ids are the strategic_dimension_id that set_competitor_scores takes. Each row has visible; hidden dimensions (set_strategic_dimension_visibility) are left out unless include_hidden is true. Read-only.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
include_hiddenbooleannoAlso return hidden dimensions (visible = false) Default: false.

list_strategic_dimension_templates

List the shared catalog of strategic dimension templates (name, description, default weight, industry).read

List Strategic Dimension Templates

List the shared catalog of strategic dimension templates (name, description, default weight, industry). Pass a template id to create_strategic_dimension to reuse one, or pass a new name there to create one. Read-only.

ParameterTypeRequiredDescription
industry_idstringnoOnly templates of this strategy.industries.id.
name_containsstringnoCase-insensitive substring of the name.
limitnumbernoDefault: 100.

create_strategic_dimension

Add a strategic dimension (a weighted criterion competitors are scored on) to a business unit.write

Create Strategic Dimension

Add a strategic dimension (a weighted criterion competitors are scored on) to a business unit. Pass template_id to reuse a catalog template, or name (+ description) to use the template with that name, or to create it when none exists. When the business unit already has that template, the existing dimension comes back with already_exists: true and nothing is written. Needs editor on the business unit, or a global admin: a refused write returns forbidden (naming the business unit), not pending_schema.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
template_idstringnostrategy.strategic_dimension_templates.id (see list_strategic_dimension_templates)
namestringnoDimension name, e.g. "Price" — used when template_id is omitted.
descriptionstringnoUsed only when a new template is created.
weightnumbernoWeight in the weighted score; default = the template weight, else 1.
industry_idstringnoIndustry of a NEW template; default = "Geral".

update_strategic_dimension

Change the weight of a strategic dimension, or rename it.write

Update Strategic Dimension

Change the weight of a strategic dimension, or rename it. A rename never edits the shared template (other business units use it): it points the dimension at the template with the new name, and creates that template when none exists (needs dfl-schema#1220). The scores of the dimension stay attached. description is used only when a new template is created.

ParameterTypeRequiredDescription
idstringyesstrategy.strategic_dimensions.id.
weightnumberno—
template_idstringnoPoint the dimension at this catalog template.
namestringnoNew name (find-or-create the template)
descriptionstringno—
industry_idstringnoIndustry of a NEW template; default = "Geral".

remove_strategic_dimension

Remove a strategic dimension from its business unit: deletes the dimension row (the link between the business unit and a template), so it leaves the BM Canvas Comparison Matrix and Chart.write

Remove Strategic Dimension

Remove a strategic dimension from its business unit: deletes the dimension row (the link between the business unit and a template), so it leaves the BM Canvas Comparison Matrix and Chart. The shared template (name, description) stays. dry_run defaults to TRUE: it writes nothing and lists the scores on the dimension. The scores are deleted with the dimension, so the call refuses when scores exist unless delete_scores: true. The response returns the deleted dimension and scores, enough to restore them with create_strategic_dimension {template_id, weight} and set_competitor_scores. Competitor screenshots of the business unit that point at the dimension get their strategic_dimension_id cleared. Needs editor on the business unit, or a global admin: a refused delete returns forbidden (naming the business unit), not pending_schema, and deletes nothing.

ParameterTypeRequiredDescription
strategic_dimension_idstringyesstrategy.strategic_dimensions.id (from list_strategic_dimensions)
dry_runbooleannotrue (default) = delete nothing, return what would be removed. Default: true.
delete_scoresbooleannoRequired (true) when the dimension has scores: they are deleted with it. Default: false.

set_strategic_dimension_visibility

Show or hide a strategic dimension.write

Set Strategic Dimension Visibility

Show or hide a strategic dimension. visible: false hides it from the BM Canvas matrix and chart, from get_competitor_comparison and from every weighted score; the scores stay and come back with visible: true. Needs editor on the business unit, or a global admin: a refused write returns forbidden (naming the business unit).

ParameterTypeRequiredDescription
idstringyesstrategy.strategic_dimensions.id (list_strategic_dimensions with include_hidden: true)
visiblebooleanyes—

set_competitor_scores

Set the score of competitors on strategic dimensions — the cells of the BM Canvas Comparison Matrix and the bars of the Chart.write

Set Competitor Scores

Set the score of competitors on strategic dimensions — the cells of the BM Canvas Comparison Matrix and the bars of the Chart. Upserts strategy.competitor_ratings by (business_unit_id, competitor_id, strategic_dimension_id). Every competitor and dimension must belong to business_unit_id, else nothing is written. Score 1–5 (the scale of the BM Canvas matrix and chart; 0 is not a score); null removes the score. Needs editor on the business unit, or a global admin: a refused write returns forbidden (naming the business unit), not pending_schema.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
scoresobject[]yes—

list_competitor_scores

Read the competitor × strategic-dimension score matrix of one business unit — the data of the BM Canvas Comparison Matrix and Chart.read

List Competitor Scores

Read the competitor × strategic-dimension score matrix of one business unit — the data of the BM Canvas Comparison Matrix and Chart. Returns the dimensions (name, weight), one row per competitor with scores keyed by strategic_dimension_id (null = not scored) and the weighted score (sum(score × weight) / sum(weight), unscored = 0, same as the UI), and the raw ratings. Archived competitors are left out unless include_archived is true. Hidden dimensions (visible = false) are left out of the matrix and the weighted score unless include_hidden is true; each dimension returns visible. Read-only.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
competitor_idstringnoOnly this competitor.
include_archivedbooleannoDefault: false.
include_hiddenbooleannoAlso use hidden dimensions (visible = false) Default: false.

get_competitor_comparison

The comparison of the competitors of one business unit: per competitor, its score on every VISIBLE strategic dimension (null = unknown), the weighted score, coverage (scored / total dimensions), the lowest paid plan per…read

Get Competitor Comparison

The comparison of the competitors of one business unit: per competitor, its score on every VISIBLE strategic dimension (null = unknown), the weighted score, coverage (scored / total dimensions), the lowest paid plan per currency (with is_estimate; no FX), business model, audience, regions and company status. The reference row (is_reference, our own product) is flagged and comes first. Each dimension also returns its coverage (competitors scored / total). Archived competitors are left out unless include_archived is true. Read-only.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
include_archivedbooleannoDefault: false.

Competitor facts (pricing, events, sources, screen types)

Section titled “Competitor facts (pricing, events, sources, screen types)”

Record the facts of a competitor company that every business unit shares: its pricing plans and lowest paid plan, dated events such as an acquisition, and the web pages that back them. Add extra screenshot screen types to a business unit.

list_entity_pricing_plans

List the pricing plans of a company (strategy.entity_pricing_plans, shared by every business unit that tracks the same entity), ordered by position, plus the lowest paid plan per currency: min monthly_equivalent over…read

List Entity Pricing Plans

List the pricing plans of a company (strategy.entity_pricing_plans, shared by every business unit that tracks the same entity), ordered by position, plus the lowest paid plan per currency: min monthly_equivalent over the plans that are not free and have a price (price null = by quote), per currency with no FX; a per_seat plan compares per seat. Read-only.

ParameterTypeRequiredDescription
entity_idstringyesstrategy.entities.id (the entity of a competitor: get_competitor → competitor.entity_id)

upsert_entity_pricing_plan

Create a pricing plan of a company (strategy.entity_pricing_plans, shared by every business unit that tracks the entity), or patch one when id is given (only the fields you pass change).write

Upsert Entity Pricing Plan

Create a pricing plan of a company (strategy.entity_pricing_plans, shared by every business unit that tracks the entity), or patch one when id is given (only the fields you pass change). price null = by quote; a priced plan needs currency (3 upper-case letters). period: month, year or one_time; billing_unit: per_seat, usage, per_channel or flat. key_limits is a JSON object (≤4 KB) of the main limits. trial_days needs has_trial. is_estimate marks a price that is not published as is. monthly_equivalent is computed by the database. Needs a DFL member.

ParameterTypeRequiredDescription
idstringnostrategy.entity_pricing_plans.id to patch; omit to create.
entity_idstringnostrategy.entities.id; required to create.
namestringnoPlan name; required to create.
pricenumbernoPrice per period (per seat for per_seat); null = by quote.
currencystringno—
periodenumnoOne of: month, year, one_time.
billing_unitenumnoOne of: per_seat, usage, per_channel, flat.
key_limitsobjectnoJSON object of the main limits, for example {"seats": 3}.
is_freebooleanno—
has_trialbooleanno—
trial_daysnumberno—
is_estimatebooleanno—
checked_onstringnoYYYY-MM-DD the price was checked; default today.
source_urlstringno—
positionnumberno—

delete_entity_pricing_plan

Delete one pricing plan of a company (strategy.entity_pricing_plans).write

Delete Entity Pricing Plan

Delete one pricing plan of a company (strategy.entity_pricing_plans). Only the member who created the plan, or a global admin, can delete it; otherwise the call returns "not allowed or not found" and deletes nothing. Returns the deleted row.

ParameterTypeRequiredDescription
idstringyesstrategy.entity_pricing_plans.id (from list_entity_pricing_plans)

add_entity_event

Record a dated company event (strategy.entity_events, shared by every business unit that tracks the entity): acquisition, rebrand, feature_discontinued, closed or other.write

Add Entity Event

Record a dated company event (strategy.entity_events, shared by every business unit that tracks the entity): acquisition, rebrand, feature_discontinued, closed or other. source_url (http/https) is required. counterparty_entity_id is the acquirer or the new brand and must be another entity. The competitor company_status is a separate per-business-unit field (update_competitor). Needs a DFL member.

ParameterTypeRequiredDescription
entity_idstringyesstrategy.entities.id.
event_typeenumyesOne of: acquisition, rebrand, feature_discontinued, closed, other.
occurred_onstringyesYYYY-MM-DD.
descriptionstringno—
counterparty_entity_idstringnostrategy.entities.id of the acquirer or the new brand.
source_urlstringyesThe page that reports the event (http/https)

update_entity_event

Patch a company event (strategy.entity_events).write

Update Entity Event

Patch a company event (strategy.entity_events). Only the fields you pass change; null clears description or counterparty_entity_id. source_url stays required (http/https). Needs a DFL member.

ParameterTypeRequiredDescription
idstringyesstrategy.entity_events.id.
event_typeenumnoOne of: acquisition, rebrand, feature_discontinued, closed, other.
occurred_onstringnoYYYY-MM-DD.
descriptionstringno—
counterparty_entity_idstringno—
source_urlstringno—

delete_entity_event

Delete one company event (strategy.entity_events).write

Delete Entity Event

Delete one company event (strategy.entity_events). Only the member who created it, or a global admin, can delete it; otherwise the call returns "not allowed or not found" and deletes nothing. Returns the deleted row.

ParameterTypeRequiredDescription
idstringyesstrategy.entity_events.id.

add_entity_source

Attach a web page as a source of a company (a competitor entity), shared by every business unit that tracks it.write

Add Entity Source

Attach a web page as a source of a company (a competitor entity), shared by every business unit that tracks it. Two writes: a strategy.sources row (source_type web_page, external_ref = url, occurred_at = accessed_on, summary = title, kind) and a strategy.artifact_sources link (artifact_table "entities", artifact_id = entity_id). If the link write fails, the new source row is deleted again. Needs a DFL member.

ParameterTypeRequiredDescription
entity_idstringyesstrategy.entities.id (get_competitor → competitor.entity_id)
urlstringyesThe page (http/https)
titlestringnoPage title (stored as the source summary)
accessed_onstringnoYYYY-MM-DD the page was read.
kindenumnoOne of: pricing, docs, review, news, other, ads, landing, post.

list_entity_sources

List the sources of a company (a competitor entity): the strategy.sources rows linked by strategy.artifact_sources with artifact_table "entities".read

List Entity Sources

List the sources of a company (a competitor entity): the strategy.sources rows linked by strategy.artifact_sources with artifact_table "entities". Each item has source_id, url, title, accessed_on, kind and created_by. Read-only.

ParameterTypeRequiredDescription
entity_idstringyesstrategy.entities.id.

delete_entity_source

Remove a source from a company (a competitor entity): deletes the strategy.artifact_sources link, then the strategy.sources row when no other link points to it.write

Delete Entity Source

Remove a source from a company (a competitor entity): deletes the strategy.artifact_sources link, then the strategy.sources row when no other link points to it. Only the member who created a row, or a global admin, can delete it: a link that is not deleted returns "not allowed or not found"; a source row that stays (other links, or not yours) is reported as kept.

ParameterTypeRequiredDescription
entity_idstringyesstrategy.entities.id.
source_idstringyesstrategy.sources.id (from list_entity_sources)

list_screen_types

List the screenshot screen types valid in a business unit: the base types (list, creation, result, calendar, detail, settings, dashboard, onboarding, other) plus the extra types of the business unit…read

List Screen Types

List the screenshot screen types valid in a business unit: the base types (list, creation, result, calendar, detail, settings, dashboard, onboarding, other) plus the extra types of the business unit (strategy.bu_screen_types). A competitor screenshot screen_type must be one of these keys. Read-only.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.

add_bu_screen_type

Add an extra screenshot screen type to a business unit (strategy.bu_screen_types).write

Add Business Unit Screen Type

Add an extra screenshot screen type to a business unit (strategy.bu_screen_types). key is snake_case (a-z, 0-9, "_", ≤40) and cannot be a base type. Needs editor on the business unit, or a global admin: a refused write returns forbidden (naming the business unit).

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
keystringyes—
labelstringyesLabel shown in the UI.
positionnumberno—

delete_bu_screen_type

Delete an extra screenshot screen type of a business unit.write

Delete Business Unit Screen Type

Delete an extra screenshot screen type of a business unit. Refused while any competitor screenshot in the business unit uses the key (the response lists them; change them with update_competitor_screenshot first). Base types cannot be deleted. Needs editor on the business unit, or a global admin: a refused write returns forbidden (naming the business unit).

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
keystringyesThe screen type key (from list_screen_types)

How a business unit writes: its voice and its writing patterns.

list_writing_patterns

List strategy.writing_patterns rows for a business_unit.read

List Writing Patterns

List strategy.writing_patterns rows for a business_unit. Each row is one "voice slot" — a reusable description of how a given surface should sound (e.g. slot "book", "youtube"). The free-form pattern jsonb holds the actual voice definition. Optionally filter by slot to fetch a single voice. Read this BEFORE writing a new slot so the new row follows the same pattern shape as the existing ones.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id whose writing patterns to list.
slotstringnoFilter to a single slot (e.g. "book", "youtube", "pedagogy_fala")
limitnumbernoDefault: 50.

upsert_writing_pattern

Create or update one strategy.writing_patterns row (a "voice slot") for a business_unit.write

Upsert Writing Pattern

Create or update one strategy.writing_patterns row (a "voice slot") for a business_unit. Resolution order: pass id to update that exact row; else pass slot and the tool updates the existing row with that slot in the business_unit, or inserts a new one if none exists. pattern is free-form jsonb — call list_writing_patterns first and mirror the shape the other slots already use, so a consumer reading every slot does not break. On update, pattern REPLACES the stored object (no deep merge) — send the whole thing.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id this writing pattern belongs to.
idstringnoRow id to update. Omit to resolve by slot (update-or-insert).
slotstringnoStable machine key for the voice surface (e.g. "book", "youtube"). Used to resolve update-vs-insert when id is not given.
namestringnoHuman-readable label shown in the BM Canvas UI.
patternobjectnoFree-form voice definition (jsonb). Existing DFL rows use: description, toneAxes [{id,left,right,value}], vocabularyDo[], vocabularyAvoid[], examplePairs [{id,onBrand,offBrand}], notes. Call list_writing_patterns first and keep those keys so existing consumers keep working; add extra keys only when the slot genuinely needs them.
versionnumbernoVersion counter for this slot.
sort_ordernumberno—

The SEO keyword list of a business unit and its search metrics.

list_keywords

List strategy.keywords rows (the SEO keyword corpus) of one business unit, ordered by text.read

List SEO Keywords

List strategy.keywords rows (the SEO keyword corpus) of one business unit, ordered by text. count is the exact number of keywords the BU holds (of locale when given), independent of limit — compare it before and after a test run to prove the run left no rows behind. Reads run under the caller's user-JWT (RLS applies).

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
localestringnoOnly the keywords of this locale ("pt-BR", "en", "es", ...). Omit it for every locale.
limitnumbernoDefault: 200.

delete_keywords

Hard-delete strategy.keywords rows by id, scoped to one business unit.write

Delete SEO Keywords

Hard-delete strategy.keywords rows by id, scoped to one business unit. Their keyword_metrics and keyword_relations rows cascade; child keywords keep their row and lose parent_keyword_id (SET NULL). The generic repair and test-cleanup path for the SEO corpus (e2e specs delete what they create). An id that is absent, belongs to another BU, or is hidden by RLS is not deleted and is listed in not_deleted_ids.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id — every id must belong to this BU.
idsstring[]yesstrategy.keywords.id values to delete.

delete_duplicate_keywords

Merge duplicate strategy.keywords rows into one canonical row, then delete the duplicates.write

Merge Duplicate Keywords

Merge duplicate strategy.keywords rows into one canonical row, then delete the duplicates. Same business unit only; you choose the canonical row (for the SEO corpus, keep the row that carries the ads data). The duplicate slugs, and every alias that pointed at a duplicate, become strategy.keyword_slug_aliases rows of the canonical keyword, so old URLs still resolve. Every reference moves to the canonical row: keyword_metrics (one row per provider stays), keyword_relations, post_keywords, ads_keywords, ads_negative_keywords, seo_page_keywords, content_pillar_keywords (pillar links and the primary flag move to the canonical keyword) and child keywords (parent_keyword_id). A link that the canonical row already has is dropped as the same fact. Before any write the tool refuses, with the list, a reference that the caller grants cannot move (a duplicate used by ads_keywords or ads_negative_keywords, or a page link that would collide); keep the keyword that carries the ads data as the canonical one. The tool re-reads every reference before it deletes and refuses if one is left. ids in campaigns.analytics_daily_metrics.attributes are not rewritten (history snapshot). dry_run defaults to TRUE: nothing is written and the report lists what would change. A re-run after a failure finishes the job. Needs editor on the business unit, or a global admin; the caller user JWT is used, RLS applies.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id; every keyword must belong to it.
canonical_keyword_idstringyesstrategy.keywords.id that stays.
duplicate_keyword_idsstring[]yesstrategy.keywords.id values to merge into the canonical row, then delete.
dry_runbooleannotrue (default) = write nothing, return the plan. Default: true.

set_keyword_slug

Rename the slug of one strategy.keywords row (lowercase a-z, 0-9 and single hyphens).write

Set Keyword Slug

Rename the slug of one strategy.keywords row (lowercase a-z, 0-9 and single hyphens). By default the old slug is kept as a strategy.keyword_slug_aliases row, so the old URL still resolves to the keyword (keep_old_slug_as_alias: false skips this). Refuses a slug that another keyword of the business unit uses, or that an alias already gives to another keyword. An alias of this keyword that equals the new slug is removed (the slug is live now). dry_run defaults to TRUE: nothing is written. Needs editor on the business unit, or a global admin; the caller user JWT is used, RLS applies.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
keyword_idstringyesstrategy.keywords.id.
new_slugstringyesNew slug: lowercase a-z, 0-9, single hyphens.
keep_old_slug_as_aliasbooleannotrue (default) = the old slug keeps resolving. Default: true.
dry_runbooleannotrue (default) = write nothing, return the plan. Default: true.

upsert_keywords

Create strategy.keywords rows (the SEO corpus) in one business unit, with an optional keyword_metrics snapshot and an optional parent (parent_keyword_id, the mind-map tree).write

Upsert SEO Keywords

Create strategy.keywords rows (the SEO corpus) in one business unit, with an optional keyword_metrics snapshot and an optional parent (parent_keyword_id, the mind-map tree). Each keyword has an optional locale ("pt-BR" by default, or "en", "es", ...). The same text can exist once per locale: a keyword outside pt-BR gets the slug "<slug>-<locale>" (for example "chatbot-en"), so it never overwrites the pt-BR row, and a slug that another locale already owns is reported in skipped. A keyword is identified by (business_unit_id, slug); the slug is the campaigns app slugifier of text, which transliterates accents ("curso de programação" and "curso de programacao" are ONE keyword, slug curso-de-programacao). An existing row with the older accent-dropping slug of the same text is found and reused, never duplicated. So is a row that matches by normalised text (accent, case and spaces ignored: UNIQUE (business_unit_id, locale, text_normalized)) or by an old slug kept as an alias: it is reused, and the slug of the new text becomes an alias of it (aliases_added). A keyword that already exists is reused and NOT changed, unless update_existing is true — then its category / cluster fields are overwritten and a new metrics snapshot is added. A metrics snapshot must name its channel (google_search, youtube_search, chatgpt_search), provider and collection_method; a browser_agent snapshot must also give source_id (the strategy.sources session row). It stores only the metric fields you give: omit a field that was not measured, and never send 0 for it. metrics.fetched_at dates the measurement. To relabel or correct existing snapshots, use update_keyword_metrics. Group keywords into a cluster by giving them the same cluster_name + cluster_color. Writes run under the caller user-JWT (RLS applies). Not a transaction: a failure after the first insert leaves the earlier rows; re-run the same batch to finish, it is idempotent.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
keywordsobject[]yes—
update_existingbooleannoDefault: false.

update_keyword_metrics

Set columns on existing strategy.keyword_metrics snapshots of one business unit: relabel the typed source (channel, provider, collection_method, source_id, market, language, raw) or set a metric (search_volume, score…write

Update SEO Keyword Metrics

Set columns on existing strategy.keyword_metrics snapshots of one business unit: relabel the typed source (channel, provider, collection_method, source_id, market, language, raw) or set a metric (search_volume, score, cpc, competition) to a value or to NULL ("not measured"). The generic repair and backfill path for keyword metrics; use upsert_keywords to ADD a snapshot. Select the rows with filter (AND of keyword_ids, metric_ids, the channel, provider, collection_method, only_unlabelled). Run with dry_run: true first: it returns the match count and before/after samples and writes nothing. Give expected_count to refuse the write when the match count differs. A result that would leave a browser_agent snapshot without source_id is refused. At most 5000 rows per call. Runs under the caller user-JWT (RLS applies).

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id — only its keywords are touched.
filterobjectyesWhich snapshots to change, inside business_unit_id. All given fields must match (AND). An empty filter means every snapshot of the business unit and then requires expected_count.
patchobjectyesColumns to set on every matched snapshot. A key you omit is not changed. null sets the column to NULL (only on the nullable fields: source_id, market, language, raw and the four metrics).
dry_runbooleannotrue = report what would change, write nothing. Default: false.
expected_countnumbernoRefuse the write unless exactly this many snapshots match. Required with an empty filter.

get_keyword_search_volume

Read the cached Google Ads Keyword Planner numbers of up to 100 keywords: search_volume, competition, cpc and the date of the measurement.read

Get Keyword Search Volume (Keyword Planner cache)

Read the cached Google Ads Keyword Planner numbers of up to 100 keywords: search_volume, competition, cpc and the date of the measurement. READ-ONLY: it reads only the strategy.keyword_metrics cache, it never calls Google Ads and it writes nothing. The cache is filled by the weekly dfl-campaigns-ingest job ads_keyword_metrics (provider google_ads, channel google_search, market 2076 = Brazil, language pt by default). Each input keyword is matched case-insensitively (trimmed) against strategy.keywords.text, optionally inside one business unit, and gets the newest snapshot for the given provider/channel/market/language. One result per input keyword, in input order, with status: measured (a snapshot exists; a search_volume of 0 is a real measurement), unmeasured (the keyword is in the corpus but has no snapshot yet: the next ads_keyword_metrics run measures it), not_in_corpus (no keyword row; add it with upsert_keywords). A value that was not measured is null, never 0. Reads run under the caller's user-JWT (RLS applies).

ParameterTypeRequiredDescription
keywordsstring[]yesKeyword texts to look up, 1 to 100. Matched trimmed and case-insensitively.
business_unit_idstringnostrategy.business_units.id — restrict the corpus to this business unit. Omit it to search every business unit you can read.
providerenumnoWho produced the numbers: dataforseo, tubebuddy, manual, csv_import, google_ads. google_ads = Google Ads Keyword Planner, the rows the dfl-campaigns-ingest job ads_keyword_metrics writes. One of: dataforseo, tubebuddy, manual, csv_import, google_ads. Default: "google_ads".
channelenumnoWhere the search happens. google_search includes Google AI Overviews. youtube_search = YouTube search. chatgpt_search = LLM answer engines (ChatGPT, Perplexity, ...); provider names the real surface. One of: google_search, youtube_search, chatgpt_search. Default: "google_search".
marketstringnoGoogle Ads geo target id. Default 2076 (Brazil), the value the ingest writes. Default: "2076".
languagestringnoLanguage code of the snapshot. Default "pt", the value the ingest writes. Default: "pt".

search_keyword_volume

ADMIN ONLY (global admin, IAM level >= 80): any other caller gets a permission error before anything is read, fetched or written, dry_run included.write

Research SEO Keywords (cached DataForSEO)

ADMIN ONLY (global admin, IAM level >= 80): any other caller gets a permission error before anything is read, fetched or written, dry_run included. Measure a known keyword list (Google search volume, CPC, competition, top-of-page bid range) for one business unit WITHOUT paying twice. A keyword that already has a dataforseo / google_search snapshot for the same location_code + language_code fetched within max_age_days is a cache HIT and is returned as stored. Only the misses go to DataForSEO, in ONE request (keywords_data/google_ads/search_volume/live, up to 1000 keywords, about $0.075 per request). The estimated cost is checked against max_cost_usd (ceiling $5) BEFORE the call; above it nothing is sent. The credential lives on the server, callers never need it. Results are saved: a strategy.sources api_run row (actual cost) plus the keywords and one typed metrics snapshot each, only with measured fields. dry_run: true returns the plan (hits, misses, estimated cost) and makes no call and no write. Default is dry_run false: the cost guard bounds the spend to one task. A keyword whose slug is empty or that Google Ads cannot take (over 80 chars, over 10 words, forbidden symbols) is listed under skipped. DataForSEO 40200 (no balance) and 40104 (unverified account) are returned as errors with nothing written. Writes run under the caller user-JWT (RLS applies). Default market: Brazil 2076 / pt.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
keywordsstring[]yesKeywords to measure. Deduplicated by the same slug rule as upsert_keywords.
location_codenumbernoDataForSEO location code. 2076 = Brazil (default), 2840 = United States. Default: 2076.
language_codestringnoDataForSEO language code, e.g. "pt" (default), "en". Default: "pt".
max_age_daysnumbernoA stored snapshot younger than this is a cache hit. Default 90. Default: 90.
max_cost_usdnumbernoRefuse (no call) when the estimated cost is above this. Default 0.50, ceiling 5. Default: 0.5.
dry_runbooleannoPlan only: no DataForSEO call, no write. Default: false.
categorystringnoPassed through to upsert for new/refreshed keywords.
cluster_namestringnoPassed through to upsert.

ingest_keyword_research

Save a WHOLE TubeBuddy keyword session in ONE call: all seeds and all their keywords with scores.write

Save a TubeBuddy keyword session (one call)

Save a WHOLE TubeBuddy keyword session in ONE call: all seeds and all their keywords with scores. Call it once at the end of the session, not once per keyword. business_unit is the id or the name ("Itera", "DevFellowship", "Tainan Fidelis"). Each keyword: text + score (TubeBuddy Overall, unweighted, 0-100, as shown); optional weighted_score, search_volume, competition, optimization (TubeBuddy indices or labels, stored as TubeBuddy data). Send only what you saw: a keyword with no score is not saved, and a 0 needs zero_confirmed: true. Optional per seed: post_id, pauta_id or idea_source_id (a Fontes source) of the Campaigns content it is for. Safe to repeat: a second call the same day updates the same rows, it does not duplicate them. Returns counts per seed, what was skipped and why, and the keywords with score >= 85. Example: {"business_unit":"Itera","seeds":[{"seed":"aprender programação","keywords":[{"text":"como aprender programação do zero","score":91},{"text":"aprender programação pelo celular","score":87,"search_volume":"Very Good"}]}]}

ParameterTypeRequiredDescription
business_unitstringyesThe business unit: its id, or its name ("Itera", "DevFellowship", "Tainan Fidelis").
sourceliteral("tubebuddy")noWhere the scores come from. Only "tubebuddy" today. Default: "tubebuddy".
seedsobject[]yesOne entry per seed, each with all the keywords you read for it.
datestringnoOptional: when you read the scores (YYYY-MM-DD or ISO 8601). Default: now.
localestringnoOptional: the language of the keywords. Default "pt-BR".
session_urlstringnoOptional: the TubeBuddy or YouTube page you read.
dry_runbooleannoCheck only: validate and resolve, write nothing. Default: false.

Customer voice (reviews, insights, competitor ads)

Section titled “Customer voice (reviews, insights, competitor ads)”

What customers say about the competitors: review excerpts with no author, the insights coded from them and their evidence counts, the links to the curated needs and pains of a segment, and the competitor ad library.

add_review_excerpts

Batch insert of review excerpts (social_proof.testimonials, kind "review_excerpt", name empty) for one business unit, with one strategy.sources row (kind "review") for the research run.write

Add Review Excerpts

Batch insert of review excerpts (social_proof.testimonials, kind "review_excerpt", name empty) for one business unit, with one strategy.sources row (kind "review") for the research run. Pass source (the run: listing URL in external_ref, the research date in occurred_at, counts in summary) or source_id (an existing run). A second call with the same source (same source_type, external_ref and occurred_at) reuses that run row. Each row is checked on its own: a row that carries an author field (name, author, handle, photo_url, linkedin_url, avatar, user, a profile or review URL, and so on), an unknown field, or personal data in the text (an email, a BR phone, a CPF, an @handle or a URL) is refused with its reasons, and the clean rows are inserted. The refusal never repeats the text. Idempotent on the md5 of the text per run: a text that the run already holds is skipped as a duplicate. With dedupe_scope competitor_source, a text that any run of the unit already holds for the same competitor and source is skipped too, and counted in skipped_existing. A row names its competitor by competitor_id or competitor_slug; with neither, the excerpt is about this business unit itself. At most 500 rows per call. Returns the inserted, skipped_duplicate, skipped_existing and refused counts with the ids. Needs editor on the business unit, or a global admin (dfl-schema#1353): a caller that is only a member, or only a viewer, is refused with forbidden: true, and a refused call leaves no strategy.sources row behind. Answers CUSTOMER_VOICE_NOT_READY until dfl-schema#1350 is applied.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
source_idstringnoAn existing strategy.sources.id (the run). Pass this or source.
sourceobjectnoThe research run. Pass this or source_id.
rowsobject[]yesThe excerpts.
dedupe_scopeenumnorun (default): a row is skipped when the same run already holds its text (md5). competitor_source: a row is also skipped when an excerpt with the same business unit, competitor (none = the unit itself), source and md5(text) already exists in ANY run; skipped_existing counts these cross-run skips (always 0 with run). One of: run, competitor_source.

upsert_customer_insight

Create or update one customer insight (strategy.customer_insights) of a business unit, found by its code (unique per business unit, for example "pain.no-time-to-study").write

Create or Update Customer Insight

Create or update one customer insight (strategy.customer_insights) of a business unit, found by its code (unique per business unit, for example "pain.no-time-to-study"). A new code creates the insight: kind and label are then required. An existing code updates only the fields you pass; null clears layer, description and customer_segment_id. kind is job, pain or gain; layer is problem (a pain of the goal) or solution (a pain with a product). customer_segment_id must be a segment of the same business unit. Link excerpts to it with add_insight_evidence, and curated canvas items with set_insight_curated_links. Needs editor on the business unit, or a global admin. Answers CUSTOMER_VOICE_NOT_READY until dfl-schema#1350 is applied.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
codestringyesStable code of the insight, unique in the business unit.
kindenumnojob, pain or gain. Required to create. One of: job, pain, gain.
layerenumnoproblem or solution. null clears. One of: problem, solution.
labelstringnoShort human label. Required to create.
descriptionstringnonull clears.
customer_segment_idstringnostrategy.customer_segments.id of this business unit. null clears.

add_insight_evidence

Batch link of excerpts (social_proof.testimonials rows, for example from add_review_excerpts) to customer insights (strategy.insight_evidence).write

Add Insight Evidence

Batch link of excerpts (social_proof.testimonials rows, for example from add_review_excerpts) to customer insights (strategy.insight_evidence). Each link names the insight by insight_id or insight_code, the testimonial_id, coded_by (the model or the person that coded it) and an optional confidence 0-1. Idempotent on the pair (insight, excerpt): a pair that exists is skipped, or updated when coded_by or confidence differ. A link whose insight or excerpt is not in this business unit is refused with its reason; the other links are written. At most 1000 links per call. Needs editor on the business unit, or a global admin. Answers CUSTOMER_VOICE_NOT_READY until dfl-schema#1350 is applied.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id (of the insights and the excerpts)
linksobject[]yes—

list_customer_insights

The customer insights of one business unit (strategy.customer_insights), each with its evidence counts from strategy.insight_evidence: the total, the count per competitor, per review source and per polarity, the number…read

List Customer Insights

The customer insights of one business unit (strategy.customer_insights), each with its evidence counts from strategy.insight_evidence: the total, the count per competitor, per review source and per polarity, the number of distinct sources, competitors and research runs, and meets_ranking_rule (at least 3 excerpts from at least 2 sources or at least 2 competitors). Filters on the insight: customer_segment_id, kind, layer. Filters on the excerpts: polarity, competitor (id or slug), source (review platform) and source_id (one research run); with an excerpt filter, the counts use only the matching excerpts and an insight with no matching excerpt is left out. Sorted by evidence count, highest first. top_n keeps the first N (ranked_only keeps only the insights that meet the rule). samples_per_insight adds up to K excerpt texts per insight, newest first. Period filters on the excerpts (they count as excerpt filters): date_from and date_to (YYYY-MM-DD, on the excerpt date, inclusive) and created_after (ISO timestamp, on the excerpt created_at, strictly after). by_month adds months [{ month, excerpts, share }] to each insight (share = its excerpts in the month divided by the distinct coded excerpts of the month in scope, 4 decimals) and month_totals at the top. Read-only. Answers CUSTOMER_VOICE_NOT_READY until dfl-schema#1350 is applied.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
customer_segment_idstringno—
kindenumnoOne of: job, pain, gain.
layerenumnoOne of: problem, solution.
polarityenumnoCount only excerpts of this polarity. One of: complaint, reason, mixed.
competitor_idstringnoCount only excerpts about this competitor.
competitor_slugstringnoInstead of competitor_id.
sourceenumnoCount only excerpts from this review platform. One of: app_store, google_play, youtube, reclame_aqui, reddit.
source_idstringnoCount only excerpts of this research run (strategy.sources.id)
include_without_evidencebooleannoKeep insights with 0 evidence (ignored with an excerpt filter) Default: true.
ranked_onlybooleannoKeep only the insights that meet the ranking rule. Default: false.
top_nnumbernoKeep the first N after the sort.
samples_per_insightnumbernoUp to K excerpt texts per insight. Default: 0.
date_fromstringnoYYYY-MM-DD: count only excerpts dated on or after it.
date_tostringnoYYYY-MM-DD: count only excerpts dated on or before it.
created_afterstringnoISO timestamp: count only excerpts stored (created_at) strictly after it.
by_monthbooleannoAdd monthly counts and shares per insight, and month_totals. Default: false.
Batch add or remove of links between customer insights and the curated items of the canvas (strategy.insight_curated_links; the count beside a curated item is its number of links).write

Set Insight Curated Links

Batch add or remove of links between customer insights and the curated items of the canvas (strategy.insight_curated_links; the count beside a curated item is its number of links). It does not replace the link set: only the items in add and remove change. A curated item is one text of a jsonb array: customer_segments.needs or .pain_points, or value_propositions.jobs, .pains or .gains (then value_proposition_id is required). customer_segment_id defaults to the segment of the insight. An add whose curated_text is not in that jsonb field is refused with the stored items as a hint (the match is exact after trim, and the link stores the stored text). The segment and the value proposition must be in the business unit of the insight. Idempotent on insight + curated_field + curated_text: an existing link is skipped; a remove of a missing link is reported as not_found. At most 500 items per list. Needs editor on the business unit, or a global admin. Answers CUSTOMER_VOICE_NOT_READY until dfl-schema#1350 is applied.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id (of the insights)
addobject[]no—
removeobject[]no—

add_competitor_ads

Batch insert or update of competitor ads (strategy.competitor_ads) for one business unit, with one strategy.sources row for the capture run (pass source, or source_id of an existing run).write

Add Competitor Ads

Batch insert or update of competitor ads (strategy.competitor_ads) for one business unit, with one strategy.sources row for the capture run (pass source, or source_id of an existing run). Idempotent on competitor + platform + ad_ref: an existing ad is updated (first_seen keeps the earliest date, last_seen the latest, the other passed fields replace, source_id becomes this run, and details is merged key by key: a key with null is removed). details is checked against the documented key list: versions (integer >= 1), promo (boolean), format (video | image | carousel | text), language (pt | en | es), audience_signal (beginner | career_switcher | dev | manager | student), hook_type (question | number_offer | social_proof | authority | fear | identity | promise), promise (text), proof (text), offer (text), cta (text), landing_hero (text), landing_price_shown (text), landing_objections (array of text), confidence (low | medium | high). An unknown key or a wrong type refuses the row with its reason; the other rows are written. insight_code is resolved to the insight of this business unit (an unknown code refuses the row). At most 500 rows per call. Needs editor on the business unit, or a global admin. Answers CUSTOMER_VOICE_NOT_READY until dfl-schema#1350 is applied.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id (of the competitors)
source_idstringnoAn existing strategy.sources.id (the capture run). Pass this or source.
sourceobjectnoThe capture run. Pass this or source_id.
rowsobject[]yes—

list_competitor_ads

The competitor ads (strategy.competitor_ads) of one business unit, each with its details object, days_active (last_seen - first_seen, in days; null when a date is missing), its competitor (slug, name), its insight…read

List Competitor Ads

The competitor ads (strategy.competitor_ads) of one business unit, each with its details object, days_active (last_seen - first_seen, in days; null when a date is missing), its competitor (slug, name), its insight (code, label) and its source row (the capture run). Filters: competitor (id or slug), platform, active_on (first_seen <= date <= last_seen), min_days_active, insight_code, promo (details.promo), min_versions (details.versions). Sorted by days_active, highest first. Use it for the monthly diff and the survivor filter of the ads plan. Read-only. Answers CUSTOMER_VOICE_NOT_READY until dfl-schema#1350 is applied.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
competitor_idstringno—
competitor_slugstringnoInstead of competitor_id.
platformstringno—
active_onstringnoYYYY-MM-DD: keep the ads seen active on that date.
min_days_activenumberno—
insight_codestringno—
promobooleannoKeep the ads whose details.promo equals this value.
min_versionsnumbernoKeep the ads with details.versions >= this value.
limitnumbernoDefault: 500.

list_review_watermarks

The review watermarks of one business unit: one row per competitor + review source that has at least one review excerpt (social_proof.testimonials, kind "review_excerpt"), with max_date (the newest review date)…read

List Review Watermarks

The review watermarks of one business unit: one row per competitor + review source that has at least one review excerpt (social_proof.testimonials, kind "review_excerpt"), with max_date (the newest review date), excerpts (the count) and last_created_at (the newest stored row). competitor is the slug, or "own_business_unit" for excerpts about the unit itself. A recurring collector reads this before a fetch, to start from max_date. Filters: competitor (competitor_id or competitor_slug, not both) and source. Sorted by competitor, then source. Read-only (RLS). Answers CUSTOMER_VOICE_NOT_READY until dfl-schema#1350 is applied.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
competitor_idstringnoOnly this competitor (strategy.competitors.id)
competitor_slugstringnoInstead of competitor_id.
sourceenumnoOnly this review platform. One of: app_store, google_play, youtube, reclame_aqui, reddit.

Competitor intel (channels, runs, change feed)

Section titled “Competitor intel (channels, runs, change feed)”

Where each competitor company is watched (its pages, ad libraries, handles and apps), the log of every collector run with its coverage per competitor, the feed of competitor changes, and the intel settings of a business unit.

set_entity_channels

Write where one competitor company is watched (strategy.entity_channels: its Meta page, Google advertiser, YouTube channel, Instagram / TikTok / X handle, landing pages, App Store / Google Play app, Reclame Aqui page).write

Set Entity Channels

Write where one competitor company is watched (strategy.entity_channels: its Meta page, Google advertiser, YouTube channel, Instagram / TikTok / X handle, landing pages, App Store / Google Play app, Reclame Aqui page). The channels belong to the company (entity), so every business unit that tracks it shares them. Pass competitor_id or competitor_slug (exactly one). Every item is checked first (kind, url, external_id format per kind, page_type only for landing_page, lengths); a bad item is returned in refused[{index, reasons}] and the valid items are written. At most 50 items. mode merge adds or updates the listed channels; mode replace also DEACTIVATES the active channels of the listed kinds that are absent from the payload. Nothing is ever deleted. Forwarded to the dfl-competitor-intel service with your own login. Needs editor on the business unit. Returns { entity_id, inserted, updated, deactivated, refused, channels }.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
competitor_idstringnostrategy.competitors.id of this business unit.
competitor_slugstringnoInstead of competitor_id.
channelsobject[]yesThe channels, at most 50.
modeenumyesmerge = add or update; replace = also deactivate absent channels of the listed kinds. One of: merge, replace.

list_entity_channels

Read where the competitors of one business unit are watched (strategy.entity_channels), grouped per competitor.read

List Entity Channels

Read where the competitors of one business unit are watched (strategy.entity_channels), grouped per competitor. Each competitor carries its channels, stale (the active channels verified more than 90 days ago or never; each channel also has stale: true/false) and missing_kinds (the channel kinds with no active channel). Filter by competitor_id or competitor_slug (not both) and by kind. Inactive channels are left out unless include_inactive. Archived competitors are left out. Read-only, with your own login (RLS).

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
competitor_idstringno—
competitor_slugstringno—
kindenumnoOne of: meta_page, google_advertiser, youtube_channel, instagram, tiktok, x, landing_page, app_store, google_play, reclame_aqui.
include_inactivebooleannoDefault: false.

add_intel_run

Start one collector run for one business unit (strategy.intel_runs, status running).write

Add Intel Run

Start one collector run for one business unit (strategy.intel_runs, status running). Idempotent on business_unit_id + collector + idempotency_key (for example facts:2026-11-16, weekly:2026-W47): an existing key returns the existing row with created false and writes nothing. collector is one of registry, facts, ads, voice, landing, posts, keywords, weekly, paid_api. Pass source_id of an existing strategy.sources row or source to create one (not both). A paid_api run needs approval_ref (the Plans App question id Tainan answered A, or on_demand:<actor>:<request>) at the start. cost_usd may be empty at the start (the price is not known before the call); update_intel_run refuses to finish a paid_api run that has no cost_usd (Q 61d7d887 = A). Finish the run with update_intel_run. Needs editor on the business unit. Returns { run_id, created, run }.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
collectorenumyesOne of: registry, facts, ads, voice, landing, posts, keywords, weekly, paid_api.
idempotency_keystringyesA retried job passes the same key and gets the same row.
runnerstringyesservice:<name>/<job>, agent:<slug>, timer:<unit>@<host> or flow:<key>.
modestringnolight, deep, daily, weekly, manual or control.
scopestringnokeywords: google_search / youtube_search; ads: meta / google; paid_api: dataforseo.
source_idstringnoAn existing strategy.sources.id.
sourceobjectnoA new strategy.sources row for this run (instead of source_id)
approval_refstringnopaid_api only: the answered Plans App question id, or on_demand:<actor>:<request>.
cost_usdnumbernopaid_api: the cost in USD, if already known (0 = a measured free call). Optional at the start; required to finish.

update_intel_run

Finish one running collector run (strategy.intel_runs): set status (ok, partial, failed, skipped or blocked), finished_at = now, and the optional counts, coverage, positive_control, cost_usd and error.write

Update Intel Run

Finish one running collector run (strategy.intel_runs): set status (ok, partial, failed, skipped or blocked), finished_at = now, and the optional counts, coverage, positive_control, cost_usd and error. Refuses a run that is no longer running. ok and partial need coverage with exactly one item per competitor of the business unit (archived competitors excluded); a skipped or failed coverage item needs a reason. failed needs error. A paid_api run needs cost_usd (0 is a measured free call) and approval_ref before it can finish, whatever the final status (Q 61d7d887 = A): pass cost_usd here if the run did not get it at the start. Needs editor on the business unit. Returns the run row.

ParameterTypeRequiredDescription
run_idstringyesstrategy.intel_runs.id.
statusenumyesOne of: ok, partial, failed, skipped, blocked.
countsobjectnoIntegers; an absent key = not measured; an unknown key is refused. Keys: found, inserted, updated, refused, changes, competitors_total, competitors_covered, skipped_existing, truncated, new_codes, llm_calls, kappa_n, kappa_polarity_milli, kappa_first_code_milli. skipped_existing = excerpts skipped because an earlier run holds them; kappa_*_milli = Cohen kappa x 1000.
coverageobject[]noOne item per competitor of the business unit.
positive_controlenumnoOne of: passed, failed, not_applicable.
cost_usdnumberno—
errorstringnoCode + short text, no secret. Required for failed.

delete_intel_runs

Remove collector runs (strategy.intel_runs) of one business unit.write

Delete Intel Runs

Remove collector runs (strategy.intel_runs) of one business unit. CAUTION: deleting a run ALSO deletes every change-feed row of that run (strategy.competitor_changes, foreign key ON DELETE CASCADE), on any business unit you edit, real ones included. Use it to clean up a test or to drop a bad run. Give run_ids (1 to 50, no duplicates). dry_run defaults to true and only lists what would be deleted (each run and its change count); send dry_run false to delete. Every run must exist and belong to the business unit, or nothing is deleted. Needs editor on the business unit (RLS). There is no undo.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
run_idsstring[]yesstrategy.intel_runs.id values to delete.
dry_runbooleannotrue (default): list only, write nothing. false: delete. Default: true.

list_intel_runs

Read the collector runs of one business unit (strategy.intel_runs), newest first: status, counts, coverage per competitor, positive_control and cost.read

List Intel Runs

Read the collector runs of one business unit (strategy.intel_runs), newest first: status, counts, coverage per competitor, positive_control and cost. A run with 0 findings is a result too ("empty is a result"). Filter by collector and since (ISO date or timestamp, on started_at). limit at most 200 (default 50). Read-only (RLS).

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
collectorenumnoOne of: registry, facts, ads, voice, landing, posts, keywords, weekly, paid_api.
sincestringnoISO date or timestamp: only runs started at or after it.
limitnumbernoDefault: 50.

add_competitor_changes

Write competitor changes of one run into the change feed (strategy.competitor_changes, append-only).write

Add Competitor Changes

Write competitor changes of one run into the change feed (strategy.competitor_changes, append-only). Pass exactly one input: changes (the change rows, already computed), diff (a before/after diff that the service turns into changes), or snapshot_diff (the output of get_canvas_snapshot_diff). The rows are computed, scored (significance, rule_version) and written by the dfl-strategy-snapshots service with your own login (POST /intel/:bu/changes); one transition seen twice on one day is written once. run_id must be a run of this business unit. Needs editor on the business unit. Returns the service answer.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
run_idstringyesstrategy.intel_runs.id (add_intel_run)
changesobject[]noChange rows (competitor_id, subject, subject_key, change, before, after, label, ...). At most 500.
diffobjectnoA before/after diff of collected facts.
snapshot_diffobjectnoThe output of get_canvas_snapshot_diff.

list_competitor_changes

Read the competitor change feed of one business unit (strategy.competitor_changes), newest first (observed_on, then detected_at).read

List Competitor Changes

Read the competitor change feed of one business unit (strategy.competitor_changes), newest first (observed_on, then detected_at). Filter by competitor_id or competitor_slug (not both), subject, min_significance (low < medium < high), since / until (YYYY-MM-DD on observed_on) and run_id. limit at most 500 (default 100). Returns { changes, runs }: runs are the collector runs of the same window, INCLUDING runs with 0 changes, each with changes_in_result, so "nothing changed" is told apart from "nobody looked". Read-only (RLS).

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
competitor_idstringno—
competitor_slugstringno—
subjectenumnoOne of: ad, pricing_plan, event, score, insight, landing_page, message, post, canvas_item.
min_significanceenumnoOne of: low, medium, high.
sincestringnoYYYY-MM-DD, inclusive.
untilstringnoYYYY-MM-DD, inclusive.
run_idstringno—
limitnumbernoDefault: 100.

get_intel_settings

Read the competitor intel settings of one business unit: { settings, intel_enabled }.read

Get Intel Settings

Read the competitor intel settings of one business unit: { settings, intel_enabled }. settings is strategy.business_units.intel_settings (null = every collector off); intel_enabled is the INTEL_ENABLED state of the dfl-competitor-intel host (read-only here). Read with your own login through the dfl-competitor-intel service (GET /intel/settings).

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.

set_intel_settings

Replace the competitor intel settings of one business unit (strategy.business_units.intel_settings).write

Set Intel Settings

Replace the competitor intel settings of one business unit (strategy.business_units.intel_settings). This is the only way to change them. Forwarded to the dfl-competitor-intel service (PUT /intel/settings) with your own login; the service checks the shape and needs editor on the business unit. A refused shape returns { error, field, reason }. Pass settings null to reset the business unit to NULL = every collector off. Returns the service answer.

ParameterTypeRequiredDescription
business_unit_idstringyesstrategy.business_units.id.
settingsobjectyesThe whole settings object (it replaces the stored one). null resets the BU to NULL = every collector off.

See which actor, OAuth client and scope this connection uses on this host.

get_current_actor

Returns who this MCP session acts as on this host: actor {id, slug, display_name, type}, client {id, name} (the OAuth client; name is null when the provider does not show it), scope ("read" or "read+write"), and source.read

Get Current Actor

Returns who this MCP session acts as on this host: actor {id, slug, display_name, type}, client {id, name} (the OAuth client; name is null when the provider does not show it), scope ("read" or "read+write"), and source. source "oauth_grant": an OAuth session, the actor is the grant actor (null when the grant has no actor, which makes the session read-only). source "agent_login": a first-party dfl-auth login of an agent user; the actor is that user's own agent actor, client and scope are null. source "first_party_login": a first-party login with no own agent actor (a human user); all three are null. source "unresolved": this host could not resolve the actor. Read-only.

Takes no parameters.

Every tool on this page authenticates with the caller’s Supabase user JWT (RLS-scoped). None of them use service_role, per the fleet-wide rule that MCP tools carry the calling user’s own privileges — writes are exactly as permitted (or blocked) by the RLS policies above.

docs tools strategy 15 domains published