mirror of
https://github.com/simstudioai/sim.git
synced 2026-10-30 19:32:46 +08:00
feat(pitchbook): add PitchBook integration (#6876)
This commit is contained in:
@@ -9340,3 +9340,18 @@ export function ZohoDeskIcon(props: SVGProps<SVGSVGElement>) {
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
export function PitchBookIcon(props: SVGProps<SVGSVGElement>) {
|
||||
return (
|
||||
<svg
|
||||
{...props}
|
||||
viewBox='-3.16 0 102 101.7'
|
||||
fill='currentColor'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
aria-hidden='true'
|
||||
>
|
||||
<path d='M75.43,0C16.66,4.78-7.6,53.48,2.06,84.09c5.67-8.73,16.21-18.24,37.78-21.76-1.25-25.79,8.08-43.79,35.59-62.33Z' />
|
||||
<path d='M45.3,66.03c-14.85,2.43-25.18,6.46-31.65,12.57.2,8.16,2.53,16.13,6.77,23.1,5.02-12.27,21.5-20.95,46.55-21.01-6.1-29.4,7.53-56.33,28.71-74.41-10.48,1.55-20.75,4.31-30.61,8.21-16.13,15.54-22.14,35.57-19.77,51.55Z' />
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ import {
|
||||
PersonaIcon,
|
||||
PineconeIcon,
|
||||
PipedriveIcon,
|
||||
PitchBookIcon,
|
||||
PolymarketIcon,
|
||||
PostgresIcon,
|
||||
PosthogIcon,
|
||||
@@ -466,6 +467,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
|
||||
persona: PersonaIcon,
|
||||
pinecone: PineconeIcon,
|
||||
pipedrive: PipedriveIcon,
|
||||
pitchbook: PitchBookIcon,
|
||||
polymarket: PolymarketIcon,
|
||||
postgresql: PostgresIcon,
|
||||
posthog: PosthogIcon,
|
||||
|
||||
@@ -188,6 +188,7 @@
|
||||
"pinecone",
|
||||
"pipedrive",
|
||||
"pipedrive-service-account",
|
||||
"pitchbook",
|
||||
"polymarket",
|
||||
"postgresql",
|
||||
"posthog",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -249,6 +249,7 @@ import { PersonaBlock, PersonaBlockMeta } from '@/blocks/blocks/persona'
|
||||
import { PiBlock } from '@/blocks/blocks/pi'
|
||||
import { PineconeBlock, PineconeBlockMeta } from '@/blocks/blocks/pinecone'
|
||||
import { PipedriveBlock, PipedriveBlockMeta } from '@/blocks/blocks/pipedrive'
|
||||
import { PitchBookBlock, PitchBookBlockMeta } from '@/blocks/blocks/pitchbook'
|
||||
import { PolymarketBlock, PolymarketBlockMeta } from '@/blocks/blocks/polymarket'
|
||||
import { PostgreSQLBlock, PostgreSQLBlockMeta } from '@/blocks/blocks/postgresql'
|
||||
import { PostHogBlock, PostHogBlockMeta } from '@/blocks/blocks/posthog'
|
||||
@@ -578,6 +579,7 @@ export const BLOCK_REGISTRY: Record<string, BlockConfig> = {
|
||||
pi: PiBlock,
|
||||
pinecone: PineconeBlock,
|
||||
pipedrive: PipedriveBlock,
|
||||
pitchbook: PitchBookBlock,
|
||||
polymarket: PolymarketBlock,
|
||||
postgresql: PostgreSQLBlock,
|
||||
posthog: PostHogBlock,
|
||||
@@ -886,6 +888,7 @@ export const BLOCK_META_REGISTRY: Record<string, BlockMeta> = {
|
||||
persona: PersonaBlockMeta,
|
||||
pinecone: PineconeBlockMeta,
|
||||
pipedrive: PipedriveBlockMeta,
|
||||
pitchbook: PitchBookBlockMeta,
|
||||
polymarket: PolymarketBlockMeta,
|
||||
postgresql: PostgreSQLBlockMeta,
|
||||
posthog: PostHogBlockMeta,
|
||||
|
||||
@@ -9340,3 +9340,18 @@ export function ZohoDeskIcon(props: SVGProps<SVGSVGElement>) {
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
export function PitchBookIcon(props: SVGProps<SVGSVGElement>) {
|
||||
return (
|
||||
<svg
|
||||
{...props}
|
||||
viewBox='-3.16 0 102 101.7'
|
||||
fill='currentColor'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
aria-hidden='true'
|
||||
>
|
||||
<path d='M75.43,0C16.66,4.78-7.6,53.48,2.06,84.09c5.67-8.73,16.21-18.24,37.78-21.76-1.25-25.79,8.08-43.79,35.59-62.33Z' />
|
||||
<path d='M45.3,66.03c-14.85,2.43-25.18,6.46-31.65,12.57.2,8.16,2.53,16.13,6.77,23.1,5.02-12.27,21.5-20.95,46.55-21.01-6.1-29.4,7.53-56.33,28.71-74.41-10.48,1.55-20.75,4.31-30.61,8.21-16.13,15.54-22.14,35.57-19.77,51.55Z' />
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ import {
|
||||
PersonaIcon,
|
||||
PineconeIcon,
|
||||
PipedriveIcon,
|
||||
PitchBookIcon,
|
||||
PolymarketIcon,
|
||||
PostgresIcon,
|
||||
PosthogIcon,
|
||||
@@ -449,6 +450,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
|
||||
persona: PersonaIcon,
|
||||
pinecone: PineconeIcon,
|
||||
pipedrive: PipedriveIcon,
|
||||
pitchbook: PitchBookIcon,
|
||||
polymarket: PolymarketIcon,
|
||||
postgresql: PostgresIcon,
|
||||
posthog: PosthogIcon,
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,12 @@
|
||||
# Recorded PitchBook responses
|
||||
|
||||
Response bodies recorded in PitchBook's published Postman collection
|
||||
("Public API V2 Documentation"), one per implemented endpoint, keyed by tool id.
|
||||
|
||||
These are the ground truth every tool's `outputs` was derived from, and
|
||||
`pitchbook.test.ts` replays each one through its tool's `transformResponse` to
|
||||
assert the produced keys still match the declared outputs.
|
||||
|
||||
Long arrays are truncated to three items and long strings to 400 characters —
|
||||
the tests assert shape, not volume. Regenerate from the collection if an
|
||||
endpoint's contract changes.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,95 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanyActiveInvestorsTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_company_active_investors',
|
||||
name: 'PitchBook Company Active Investors',
|
||||
description: 'Retrieve only the investors currently holding a position in a company',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/active-investors`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch company active investors')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
activeInvestors: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
activeInvestors: {
|
||||
type: 'array',
|
||||
description: 'Investors currently holding a position in the company',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID' },
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID' },
|
||||
investorName: { type: 'string', description: 'Investor name' },
|
||||
investorTypes: {
|
||||
type: 'array',
|
||||
description: 'Types the investor is classified as, one flagged primary',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary entry' },
|
||||
type: {
|
||||
type: 'object',
|
||||
description: 'Type as a code and description pair',
|
||||
properties: {
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
},
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
investorSince: {
|
||||
type: 'string',
|
||||
description: 'Date the investor first invested (YYYY-MM-DD)',
|
||||
},
|
||||
holding: { type: 'string', description: 'Current holding status' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanyBioTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_company_bio',
|
||||
name: 'PitchBook Company Bio',
|
||||
description:
|
||||
'Retrieve the core profile of a company: names, description, HQ, status, headcount, total raised, and social links',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/bio`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch company bio')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
companyId: data.companyId ?? null,
|
||||
companyName: data.companyName ?? null,
|
||||
parentCompanyId: data.parentCompanyId ?? null,
|
||||
parentCompanyName: data.parentCompanyName ?? null,
|
||||
hqLocation: data.hqLocation ?? null,
|
||||
description: data.description ?? null,
|
||||
financingStatus: data.financingStatus ?? null,
|
||||
businessStatus: data.businessStatus ?? null,
|
||||
ownershipStatus: data.ownershipStatus ?? null,
|
||||
website: data.website ?? null,
|
||||
employees: data.employees ?? null,
|
||||
yearFounded: data.yearFounded ?? null,
|
||||
exchange: data.exchange ?? null,
|
||||
ticker: data.ticker ?? null,
|
||||
financingStatusNote: data.financingStatusNote ?? null,
|
||||
totalMoneyRaised: data.totalMoneyRaised ?? null,
|
||||
morningstarCode: data.morningstarCode ?? null,
|
||||
cikCode: data.cikCode ?? null,
|
||||
companySocialURLs: data.companySocialURLs ?? null,
|
||||
pitchBookProfileLink: data.pitchBookProfileLink ?? null,
|
||||
universe: data.universe ?? [],
|
||||
employeeHistory: data.employeeHistory ?? [],
|
||||
sicCodes: data.sicCodes ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID', nullable: true },
|
||||
companyName: {
|
||||
type: 'object',
|
||||
description: 'The names the company is known by',
|
||||
properties: {
|
||||
formalName: { type: 'string', description: 'Formal name', nullable: true },
|
||||
alsoKnownAs: { type: 'string', description: 'Also-known-as name', nullable: true },
|
||||
legalName: { type: 'string', description: 'Registered legal name', nullable: true },
|
||||
formerlyKnownAs: { type: 'string', description: 'Previous name', nullable: true },
|
||||
},
|
||||
},
|
||||
parentCompanyId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the parent company',
|
||||
nullable: true,
|
||||
},
|
||||
parentCompanyName: {
|
||||
type: 'string',
|
||||
description: 'Name of the parent company',
|
||||
nullable: true,
|
||||
},
|
||||
hqLocation: {
|
||||
type: 'object',
|
||||
description: 'Headquarters location',
|
||||
nullable: true,
|
||||
properties: {
|
||||
city: { type: 'string', description: 'City', nullable: true },
|
||||
stateProvince: { type: 'string', description: 'State or province', nullable: true },
|
||||
postCode: { type: 'string', description: 'Postal code', nullable: true },
|
||||
country: { type: 'string', description: 'Country', nullable: true },
|
||||
},
|
||||
},
|
||||
description: { type: 'string', description: 'Business description', nullable: true },
|
||||
financingStatus: {
|
||||
type: 'object',
|
||||
description: 'How the company is financed',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
businessStatus: {
|
||||
type: 'object',
|
||||
description: 'Operating status of the business',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
ownershipStatus: {
|
||||
type: 'object',
|
||||
description: 'Ownership status of the company',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
universe: {
|
||||
type: 'array',
|
||||
description: 'PitchBook universes the company belongs to',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Universe code' },
|
||||
description: { type: 'string', description: 'Universe label' },
|
||||
},
|
||||
},
|
||||
},
|
||||
website: { type: 'string', description: 'Company website', nullable: true },
|
||||
employees: { type: 'number', description: 'Current employee count', nullable: true },
|
||||
employeeHistory: {
|
||||
type: 'array',
|
||||
description: 'Reported headcount over time',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
asOfDate: { type: 'string', description: 'Date the count was reported (YYYY-MM-DD)' },
|
||||
employeeCount: { type: 'number', description: 'Headcount on that date' },
|
||||
},
|
||||
},
|
||||
},
|
||||
exchange: {
|
||||
type: 'string',
|
||||
description: 'Stock exchange the company trades on',
|
||||
nullable: true,
|
||||
},
|
||||
ticker: { type: 'string', description: 'Stock ticker', nullable: true },
|
||||
yearFounded: { type: 'number', description: 'Year the company was founded', nullable: true },
|
||||
financingStatusNote: {
|
||||
type: 'object',
|
||||
description: 'Analyst note explaining the financing status',
|
||||
nullable: true,
|
||||
properties: {
|
||||
note: { type: 'string', description: 'Note text', nullable: true },
|
||||
asOfDate: { type: 'string', description: 'Date of the note (YYYY-MM-DD)', nullable: true },
|
||||
},
|
||||
},
|
||||
totalMoneyRaised: {
|
||||
type: 'object',
|
||||
description: 'Total capital raised to date',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
sicCodes: {
|
||||
type: 'array',
|
||||
description: 'SIC classification codes',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'SIC code' },
|
||||
description: { type: 'string', description: 'SIC code label' },
|
||||
},
|
||||
},
|
||||
},
|
||||
morningstarCode: { type: 'string', description: 'Morningstar identifier', nullable: true },
|
||||
cikCode: { type: 'string', description: 'SEC CIK identifier', nullable: true },
|
||||
companySocialURLs: {
|
||||
type: 'object',
|
||||
description: 'Social profile links',
|
||||
nullable: true,
|
||||
properties: {
|
||||
facebookProfileUrl: { type: 'string', description: 'Facebook profile', nullable: true },
|
||||
twitterProfileUrl: { type: 'string', description: 'X/Twitter profile', nullable: true },
|
||||
linkedInProfileUrl: { type: 'string', description: 'LinkedIn profile', nullable: true },
|
||||
},
|
||||
},
|
||||
pitchBookProfileLink: {
|
||||
type: 'string',
|
||||
description: 'Link to the company profile in the PitchBook platform',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanyDealServiceProvidersTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_company_deal_service_providers',
|
||||
name: 'PitchBook Company Deal Service Providers',
|
||||
description:
|
||||
'Retrieve the service providers that worked on a company deals, and what each was hired for',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/deal-service-providers`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch company deal service providers')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
dealServiceProviders: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
dealServiceProviders: {
|
||||
type: 'array',
|
||||
description: 'Service providers engaged on the company deals',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
serviceProviderId: { type: 'string', description: 'PitchBook service provider ID' },
|
||||
serviceProviderName: { type: 'string', description: 'Service provider name' },
|
||||
serviceProviderTypes: {
|
||||
type: 'array',
|
||||
description: 'Types the service provider is classified as',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary entry' },
|
||||
type: {
|
||||
type: 'object',
|
||||
description: 'Type as a code and description pair',
|
||||
properties: {
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
},
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
serviceProvided: {
|
||||
type: 'object',
|
||||
description: 'Service provided, as a code and description pair',
|
||||
properties: {
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
dealIdServiceProvided: {
|
||||
type: 'string',
|
||||
description: 'PitchBook deal ID the service was provided on',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanyDealsTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_company_deals',
|
||||
name: 'PitchBook Company Deals',
|
||||
description:
|
||||
'Retrieve every deal a company has been involved in, in chronological order with its deal type',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/deals`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch company deals')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
deals: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
deals: {
|
||||
type: 'array',
|
||||
description: 'Deals involving the company, oldest first',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID' },
|
||||
dealId: { type: 'string', description: 'PitchBook deal ID' },
|
||||
dealDate: {
|
||||
type: 'string',
|
||||
description: 'Date of the deal (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
dealType1: {
|
||||
type: 'object',
|
||||
description: 'Primary deal type',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Deal type code', nullable: true },
|
||||
description: { type: 'string', description: 'Deal type label', nullable: true },
|
||||
},
|
||||
},
|
||||
dealType2: {
|
||||
type: 'object',
|
||||
description: 'Secondary deal type, such as the round letter',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Deal type code', nullable: true },
|
||||
description: { type: 'string', description: 'Deal type label', nullable: true },
|
||||
},
|
||||
},
|
||||
dealType3: {
|
||||
type: 'object',
|
||||
description: 'Tertiary deal type',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Deal type code', nullable: true },
|
||||
description: { type: 'string', description: 'Deal type label', nullable: true },
|
||||
},
|
||||
},
|
||||
dealNumber: {
|
||||
type: 'number',
|
||||
description: 'Sequence of this deal in the company financing history',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanyFinancialsTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> =
|
||||
{
|
||||
id: 'pitchbook_company_financials',
|
||||
name: 'PitchBook Company Financials',
|
||||
description:
|
||||
'Retrieve reported financials for a private company across every available fiscal period. Annual data is returned by default.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/financials`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch company financials')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
companyId: data.companyId ?? null,
|
||||
items: data.items ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID' },
|
||||
items: {
|
||||
type: 'array',
|
||||
description: 'Records returned',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
period: { type: 'string', description: 'Fiscal period the figures cover' },
|
||||
endDate: { type: 'string', description: 'End date (YYYY-MM-DD)' },
|
||||
enterpriseValue: {
|
||||
type: 'object',
|
||||
description: 'Enterprise value',
|
||||
nullable: true,
|
||||
properties: {
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
},
|
||||
},
|
||||
revenue: {
|
||||
type: 'object',
|
||||
description: 'Revenue',
|
||||
nullable: true,
|
||||
properties: {
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
},
|
||||
},
|
||||
netIncome: {
|
||||
type: 'object',
|
||||
description: 'Net income',
|
||||
properties: {
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
},
|
||||
},
|
||||
ebitda: {
|
||||
type: 'object',
|
||||
description: 'EBITDA',
|
||||
properties: {
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
},
|
||||
},
|
||||
totalAssets: {
|
||||
type: 'object',
|
||||
description: 'Total assets',
|
||||
nullable: true,
|
||||
properties: {
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
},
|
||||
},
|
||||
totalDebt: {
|
||||
type: 'object',
|
||||
description: 'Total debt',
|
||||
nullable: true,
|
||||
properties: {
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanyGeneralServiceProvidersTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_company_general_service_providers',
|
||||
name: 'PitchBook Company General Service Providers',
|
||||
description: 'Retrieve the current and former general service providers engaged by a company',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) =>
|
||||
`${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/general-service-providers`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch company general service providers')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
companyId: data.companyId ?? null,
|
||||
currentGeneralServices: data.currentGeneralServices ?? [],
|
||||
formerGeneralServices: data.formerGeneralServices ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID', nullable: true },
|
||||
currentGeneralServices: {
|
||||
type: 'array',
|
||||
description: 'Current general service relationships',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
serviceProviderId: { type: 'string', description: 'PitchBook service provider ID' },
|
||||
serviceProviderName: { type: 'string', description: 'Service provider name' },
|
||||
serviceProviderTypes: {
|
||||
type: 'array',
|
||||
description: 'Types the service provider is classified as',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary entry' },
|
||||
type: {
|
||||
type: 'object',
|
||||
description: 'Type as a code and description pair',
|
||||
properties: {
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
},
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
serviceProvided: {
|
||||
type: 'object',
|
||||
description: 'Service provided, as a code and description pair',
|
||||
properties: {
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
formerGeneralServices: {
|
||||
type: 'array',
|
||||
description: 'Former general service relationships',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
serviceProviderId: { type: 'string', description: 'PitchBook service provider ID' },
|
||||
serviceProviderName: { type: 'string', description: 'Service provider name' },
|
||||
serviceProviderTypes: {
|
||||
type: 'array',
|
||||
description: 'Types the service provider is classified as',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary entry' },
|
||||
type: {
|
||||
type: 'object',
|
||||
description: 'Type as a code and description pair',
|
||||
properties: {
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
},
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
serviceProvided: {
|
||||
type: 'object',
|
||||
description: 'Service provided, as a code and description pair',
|
||||
properties: {
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanyIndustriesTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> =
|
||||
{
|
||||
id: 'pitchbook_company_industries',
|
||||
name: 'PitchBook Company Industries',
|
||||
description:
|
||||
'Retrieve the industry classification, verticals, keywords, and emerging spaces assigned to a company',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/industries`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch company industries')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
companyId: data.companyId ?? null,
|
||||
industries: data.industries ?? [],
|
||||
verticals: data.verticals ?? [],
|
||||
keywords: data.keywords ?? [],
|
||||
emergingSpaces: data.emergingSpaces ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID' },
|
||||
industries: {
|
||||
type: 'array',
|
||||
description: 'Industry classifications, most specific first. One entry is flagged primary.',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
industrySector: {
|
||||
type: 'object',
|
||||
description: 'Top-level sector',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Sector code' },
|
||||
description: { type: 'string', description: 'Sector label' },
|
||||
},
|
||||
},
|
||||
industryGroup: {
|
||||
type: 'object',
|
||||
description: 'Industry group within the sector',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Group code' },
|
||||
description: { type: 'string', description: 'Group label' },
|
||||
},
|
||||
},
|
||||
industryCode: {
|
||||
type: 'object',
|
||||
description: 'Most specific industry classification',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Industry code' },
|
||||
description: { type: 'string', description: 'Industry label' },
|
||||
},
|
||||
},
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary industry' },
|
||||
},
|
||||
},
|
||||
},
|
||||
verticals: {
|
||||
type: 'array',
|
||||
description: 'Verticals the company operates in',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Vertical code' },
|
||||
description: { type: 'string', description: 'Vertical label' },
|
||||
},
|
||||
},
|
||||
},
|
||||
keywords: {
|
||||
type: 'array',
|
||||
description: 'Keywords associated with the company',
|
||||
items: { type: 'string', description: 'Keyword' },
|
||||
},
|
||||
emergingSpaces: {
|
||||
type: 'array',
|
||||
description: 'Analyst-defined emerging spaces the company is placed in',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Emerging space code' },
|
||||
description: { type: 'string', description: 'Emerging space label' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanyInvestorsTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> =
|
||||
{
|
||||
id: 'pitchbook_company_investors',
|
||||
name: 'PitchBook Company Investors',
|
||||
description:
|
||||
'Retrieve every investor in a company, current and former, with the type of investor and when they invested',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/investors`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch company investors')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
countAllInvestors: data.countAllInvestors ?? 0,
|
||||
investors: data.investors ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
countAllInvestors: { type: 'number', description: 'Total number of investors on record' },
|
||||
investors: {
|
||||
type: 'array',
|
||||
description: 'Investors in the company, current and former',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID' },
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID' },
|
||||
investorName: { type: 'string', description: 'Investor name' },
|
||||
investorTypes: {
|
||||
type: 'array',
|
||||
description: 'Types the investor is classified as, one flagged primary',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
type: {
|
||||
type: 'object',
|
||||
description: 'Investor type',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Investor type code' },
|
||||
description: { type: 'string', description: 'Investor type label' },
|
||||
},
|
||||
},
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary type' },
|
||||
},
|
||||
},
|
||||
},
|
||||
investorSince: {
|
||||
type: 'string',
|
||||
description: 'Date the investor first invested (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
investorExit: {
|
||||
type: 'string',
|
||||
description: 'Date the investor exited (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
investorStatus: {
|
||||
type: 'object',
|
||||
description: 'Whether the investor is current or former',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Status code', nullable: true },
|
||||
description: { type: 'string', description: 'Status label', nullable: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanyMostRecentDebtFinancingTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_company_most_recent_debt_financing',
|
||||
name: 'PitchBook Company Most Recent Debt Financing',
|
||||
description:
|
||||
'Retrieve a company most recent debt financing, including each debt instrument raised',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) =>
|
||||
`${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/most-recent-debt-financing`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch most recent debt financing')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
companyId: data.companyId ?? null,
|
||||
lastDebtFinancingDealId: data.lastDebtFinancingDealId ?? null,
|
||||
lastDebtFinancingDate: data.lastDebtFinancingDate ?? null,
|
||||
lastDebtFinancing: data.lastDebtFinancing ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID', nullable: true },
|
||||
lastDebtFinancingDealId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook deal ID of the most recent debt financing',
|
||||
nullable: true,
|
||||
},
|
||||
lastDebtFinancingDate: {
|
||||
type: 'string',
|
||||
description: 'Date of the most recent debt financing (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
lastDebtFinancing: {
|
||||
type: 'array',
|
||||
description: 'Debt instruments in the most recent debt financing',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
lastDebtFinancingType: {
|
||||
type: 'object',
|
||||
description: 'Type of the most recent debt financing',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
lastDebtFinancingAmount: {
|
||||
type: 'object',
|
||||
description: 'Amount of the most recent debt financing',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
seniority: { type: 'json', description: 'Seniority of the debt', nullable: true },
|
||||
security: { type: 'json', description: 'Security backing the debt', nullable: true },
|
||||
subordination: { type: 'json', description: 'Subordination terms', nullable: true },
|
||||
term: { type: 'json', description: 'Term of the debt', nullable: true },
|
||||
additionalDebtCharacteristics: {
|
||||
type: 'object',
|
||||
description: 'Other characteristics of the debt',
|
||||
properties: {
|
||||
unitranche: { type: 'boolean', description: 'Whether the debt is unitranche' },
|
||||
syndicated: { type: 'boolean', description: 'Whether the debt is syndicated' },
|
||||
mezzanine: { type: 'boolean', description: 'Whether the debt is mezzanine' },
|
||||
covLite: { type: 'boolean', description: 'Whether the debt is covenant-lite' },
|
||||
warrants: { type: 'boolean', description: 'Whether warrants are attached' },
|
||||
convertible: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the instrument is convertible',
|
||||
},
|
||||
rate: { type: 'json', description: 'Interest rate', nullable: true },
|
||||
},
|
||||
},
|
||||
lenders: {
|
||||
type: 'array',
|
||||
description: 'Lenders on the debt',
|
||||
items: { type: 'json' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanyMostRecentFinancialsTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_company_most_recent_financials',
|
||||
name: 'PitchBook Company Most Recent Financials',
|
||||
description:
|
||||
'Retrieve the most recent reported financials for a private company: revenue, net income, EBITDA, assets, and debt',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/most-recent-financials`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch most recent financials')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
companyId: data.companyId ?? null,
|
||||
period: data.period ?? null,
|
||||
endDate: data.endDate ?? null,
|
||||
enterpriseValue: data.enterpriseValue ?? null,
|
||||
revenue: data.revenue ?? null,
|
||||
netIncome: data.netIncome ?? null,
|
||||
ebitda: data.ebitda ?? null,
|
||||
totalAssets: data.totalAssets ?? null,
|
||||
totalDebt: data.totalDebt ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID', nullable: true },
|
||||
period: { type: 'number', description: 'Fiscal period the figures cover', nullable: true },
|
||||
endDate: { type: 'string', description: 'Period end date (YYYY-MM-DD)', nullable: true },
|
||||
enterpriseValue: {
|
||||
type: 'object',
|
||||
description: 'Enterprise value',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
revenue: {
|
||||
type: 'object',
|
||||
description: 'Revenue',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
netIncome: {
|
||||
type: 'object',
|
||||
description: 'Net income',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
ebitda: {
|
||||
type: 'object',
|
||||
description: 'EBITDA',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
totalAssets: {
|
||||
type: 'object',
|
||||
description: 'Total assets',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
totalDebt: {
|
||||
type: 'object',
|
||||
description: 'Total debt',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanyMostRecentFinancingTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_company_most_recent_financing',
|
||||
name: 'PitchBook Company Most Recent Financing',
|
||||
description:
|
||||
'Retrieve a company most recent financing round: date, size, type, and last known valuation',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/most-recent-financing`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch most recent financing')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
companyId: data.companyId ?? null,
|
||||
lastFinancingDealId: data.lastFinancingDealId ?? null,
|
||||
lastFinancingDate: data.lastFinancingDate ?? null,
|
||||
lastFinancingSize: data.lastFinancingSize ?? null,
|
||||
lastFinancingSizeStatus: data.lastFinancingSizeStatus ?? null,
|
||||
lastFinancingValuation: data.lastFinancingValuation ?? null,
|
||||
lastFinancingValuationStatus: data.lastFinancingValuationStatus ?? null,
|
||||
lastFinancingDealType: data.lastFinancingDealType ?? null,
|
||||
lastFinancingDealType2: data.lastFinancingDealType2 ?? null,
|
||||
lastFinancingDealType3: data.lastFinancingDealType3 ?? null,
|
||||
lastFinancingDealClass: data.lastFinancingDealClass ?? null,
|
||||
lastKnownValuation: data.lastKnownValuation ?? null,
|
||||
lastKnownValuationDate: data.lastKnownValuationDate ?? null,
|
||||
lastKnownValuationDealType: data.lastKnownValuationDealType ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID', nullable: true },
|
||||
lastFinancingDealId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook deal ID of the most recent financing',
|
||||
nullable: true,
|
||||
},
|
||||
lastFinancingDate: {
|
||||
type: 'string',
|
||||
description: 'Date of the most recent financing (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
lastFinancingSize: {
|
||||
type: 'object',
|
||||
description: 'Size of the most recent financing',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
lastFinancingSizeStatus: {
|
||||
type: 'string',
|
||||
description: 'Whether the financing size is actual or estimated',
|
||||
nullable: true,
|
||||
},
|
||||
lastFinancingValuation: {
|
||||
type: 'object',
|
||||
description: 'Valuation at the most recent financing',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
lastFinancingValuationStatus: {
|
||||
type: 'string',
|
||||
description: 'Whether the valuation is actual or estimated',
|
||||
nullable: true,
|
||||
},
|
||||
lastFinancingDealType: {
|
||||
type: 'object',
|
||||
description: 'Primary deal type of the most recent financing',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
lastFinancingDealType2: {
|
||||
type: 'object',
|
||||
description: 'Secondary deal type of the most recent financing',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
lastFinancingDealType3: {
|
||||
type: 'object',
|
||||
description: 'Tertiary deal type of the most recent financing',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
lastFinancingDealClass: {
|
||||
type: 'object',
|
||||
description: 'Deal class of the most recent financing',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
lastKnownValuation: {
|
||||
type: 'object',
|
||||
description: 'Most recent known valuation of the company',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
lastKnownValuationDate: {
|
||||
type: 'string',
|
||||
description: 'Date of the last known valuation (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
lastKnownValuationDealType: {
|
||||
type: 'object',
|
||||
description: 'Deal type the last known valuation came from',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
import type { PitchbookCompanySearchParams, PitchbookSearchResponse } from '@/tools/pitchbook/types'
|
||||
import {
|
||||
buildSearchQuery,
|
||||
mapStats,
|
||||
PITCHBOOK_API_BASE,
|
||||
pitchbookAuthHeaders,
|
||||
throwIfNotOk,
|
||||
} from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanySearchTool: ToolConfig<
|
||||
PitchbookCompanySearchParams,
|
||||
PitchbookSearchResponse
|
||||
> = {
|
||||
id: 'pitchbook_company_search',
|
||||
name: 'PitchBook Company Search',
|
||||
description:
|
||||
'Search PitchBook for companies by name, location, industry, funding, deal activity, and more',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
companyNames: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated company names, PitchBook IDs, websites, or tickers',
|
||||
},
|
||||
keywords: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Keywords associated with the company or appearing in its business description',
|
||||
},
|
||||
city: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'City the company is located in',
|
||||
},
|
||||
stateProvince: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'State or province the company is located in',
|
||||
},
|
||||
country: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Country the company is located in (e.g. USA)',
|
||||
},
|
||||
locationType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Restrict location matching to HQ_ONLY, NON_HQ_ONLY, or ANY',
|
||||
},
|
||||
ownershipStatus: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook ownership status code',
|
||||
},
|
||||
businessStatus: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook business status code',
|
||||
},
|
||||
dateFounded: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Founding date filter. Use >YYYY-MM-DD, <YYYY-MM-DD, or YYYY-MM-DD^YYYY-MM-DD for a range',
|
||||
},
|
||||
industry: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook industry code',
|
||||
},
|
||||
verticals: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook vertical code',
|
||||
},
|
||||
dealType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook deal type code (e.g. evc for early-stage VC)',
|
||||
},
|
||||
dealSize: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Deal size in millions. Use >100, <100, or 10^100 for a range',
|
||||
},
|
||||
dealDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Deal date filter. Use >YYYY-MM-DD, <YYYY-MM-DD, or YYYY-MM-DD^YYYY-MM-DD for a range',
|
||||
},
|
||||
totalRaised: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Total raised to date in millions. Use >100, <100, or 10^100 for a range',
|
||||
},
|
||||
investorNames: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated investor names, PitchBook IDs, websites, or tickers',
|
||||
},
|
||||
employeeCount: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Employee count. Use >100, <100, or 10^100 for a range',
|
||||
},
|
||||
revenue: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Revenue in millions. Use >100, <100, or 10^100 for a range',
|
||||
},
|
||||
filterCurrency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code the monetary filters on this search are expressed in, e.g. setting EUR means dealSize is read as millions of euros. Distinct from `currency`, which converts the values PitchBook returns.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
page: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Page of results to return, starting at 1',
|
||||
},
|
||||
perPage: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'How many results to return per page',
|
||||
},
|
||||
additionalFilters: {
|
||||
type: 'json',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Any other documented search filter, as a JSON object of query parameter names to values (e.g. {"emergingSpaces": "AGTECH"}). A dedicated field always wins over the same key set here.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const query = buildSearchQuery(
|
||||
{
|
||||
companyNames: params.companyNames,
|
||||
keywords: params.keywords,
|
||||
city: params.city,
|
||||
stateProvince: params.stateProvince,
|
||||
country: params.country,
|
||||
locationType: params.locationType,
|
||||
ownershipStatus: params.ownershipStatus,
|
||||
businessStatus: params.businessStatus,
|
||||
dateFounded: params.dateFounded,
|
||||
industry: params.industry,
|
||||
verticals: params.verticals,
|
||||
dealType: params.dealType,
|
||||
dealSize: params.dealSize,
|
||||
dealDate: params.dealDate,
|
||||
totalRaised: params.totalRaised,
|
||||
investorNames: params.investorNames,
|
||||
employeeCount: params.employeeCount,
|
||||
revenue: params.revenue,
|
||||
currency: params.filterCurrency,
|
||||
},
|
||||
{
|
||||
page: params.page,
|
||||
perPage: params.perPage,
|
||||
additionalFilters: params.additionalFilters,
|
||||
}
|
||||
)
|
||||
return `${PITCHBOOK_API_BASE}/companies/search${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to search companies')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stats: mapStats(data.stats),
|
||||
items: data.items ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stats: {
|
||||
type: 'object',
|
||||
description: 'Paging envelope for the result set',
|
||||
properties: {
|
||||
total: { type: 'number', description: 'Total number of matching results' },
|
||||
perPage: { type: 'number', description: 'Results returned per page' },
|
||||
page: { type: 'number', description: 'Current page number' },
|
||||
lastPage: { type: 'number', description: 'Number of the last available page' },
|
||||
},
|
||||
},
|
||||
items: {
|
||||
type: 'array',
|
||||
description: 'Companies matching the search criteria',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID' },
|
||||
companyName: { type: 'string', description: 'Company name' },
|
||||
website: { type: 'string', description: 'Company website', nullable: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanySimilarCompaniesTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_company_similar_companies',
|
||||
name: 'PitchBook Similar Companies',
|
||||
description:
|
||||
'Retrieve companies PitchBook scores as similar to a given company, flagging which are direct competitors',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/similar-companies`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch similar companies')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
similarCompanies: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
similarCompanies: {
|
||||
type: 'array',
|
||||
description: 'Similar companies, most similar first',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
companyId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the company compared against',
|
||||
},
|
||||
similarCompanyId: { type: 'string', description: 'PitchBook ID of the similar company' },
|
||||
similarCompanyName: { type: 'string', description: 'Name of the similar company' },
|
||||
similarityScore: {
|
||||
type: 'number',
|
||||
description: 'Similarity score between 0 and 1, higher is more similar',
|
||||
},
|
||||
competitor: {
|
||||
type: 'boolean',
|
||||
description: 'Whether PitchBook classifies the company as a direct competitor',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
import type {
|
||||
PitchbookCompanySocialAnalyticsParams,
|
||||
PitchbookResponse,
|
||||
} from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanySocialAnalyticsTool: ToolConfig<
|
||||
PitchbookCompanySocialAnalyticsParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_company_social_analytics',
|
||||
name: 'PitchBook Company Social Analytics',
|
||||
description:
|
||||
'Retrieve web and social growth and size metrics for a company, with percentile ranks',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
compare: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Benchmark the signals against a peer set: SIMILAR_COMPANIES, INDUSTRY, VERTICALS, or ALL_COMPANIES',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.compare) qs.set('compare', params.compare.trim())
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/social-analytics${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch company social analytics')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
companyId: data.companyId ?? null,
|
||||
growthRate: data.growthRate ?? null,
|
||||
growthRatePercentile: data.growthRatePercentile ?? null,
|
||||
growthRateChange: data.growthRateChange ?? null,
|
||||
growthRatePercentChange: data.growthRatePercentChange ?? null,
|
||||
webGrowthRate: data.webGrowthRate ?? null,
|
||||
webGrowthRatePercentile: data.webGrowthRatePercentile ?? null,
|
||||
socialGrowthRate: data.socialGrowthRate ?? null,
|
||||
socialGrowthRatePercentile: data.socialGrowthRatePercentile ?? null,
|
||||
sizeMultiple: data.sizeMultiple ?? null,
|
||||
sizeMultiplePercentile: data.sizeMultiplePercentile ?? null,
|
||||
sizeMultipleChange: data.sizeMultipleChange ?? null,
|
||||
sizeMultiplePercentChange: data.sizeMultiplePercentChange ?? null,
|
||||
webSizeMultiple: data.webSizeMultiple ?? null,
|
||||
webSizeMultiplePercentile: data.webSizeMultiplePercentile ?? null,
|
||||
socialSizeMultiple: data.socialSizeMultiple ?? null,
|
||||
socialSizeMultiplePercentile: data.socialSizeMultiplePercentile ?? null,
|
||||
twitterFollowers: data.twitterFollowers ?? null,
|
||||
twitterFollowersChange: data.twitterFollowersChange ?? null,
|
||||
twitterFollowersPercentChange: data.twitterFollowersPercentChange ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID', nullable: true },
|
||||
growthRate: { type: 'number', description: 'Overall growth rate', nullable: true },
|
||||
growthRatePercentile: {
|
||||
type: 'number',
|
||||
description: 'Percentile of the overall growth rate',
|
||||
nullable: true,
|
||||
},
|
||||
growthRateChange: {
|
||||
type: 'number',
|
||||
description: 'Change in the overall growth rate',
|
||||
nullable: true,
|
||||
},
|
||||
growthRatePercentChange: {
|
||||
type: 'number',
|
||||
description: 'Percent change in the overall growth rate',
|
||||
nullable: true,
|
||||
},
|
||||
webGrowthRate: { type: 'number', description: 'Web traffic growth rate', nullable: true },
|
||||
webGrowthRatePercentile: {
|
||||
type: 'number',
|
||||
description: 'Percentile of the web growth rate',
|
||||
nullable: true,
|
||||
},
|
||||
socialGrowthRate: {
|
||||
type: 'number',
|
||||
description: 'Social following growth rate',
|
||||
nullable: true,
|
||||
},
|
||||
socialGrowthRatePercentile: {
|
||||
type: 'number',
|
||||
description: 'Percentile of the social growth rate',
|
||||
nullable: true,
|
||||
},
|
||||
sizeMultiple: { type: 'number', description: 'Overall size multiple', nullable: true },
|
||||
sizeMultiplePercentile: {
|
||||
type: 'number',
|
||||
description: 'Percentile of the size multiple',
|
||||
nullable: true,
|
||||
},
|
||||
sizeMultipleChange: {
|
||||
type: 'number',
|
||||
description: 'Change in the size multiple',
|
||||
nullable: true,
|
||||
},
|
||||
sizeMultiplePercentChange: {
|
||||
type: 'number',
|
||||
description: 'Percent change in the size multiple',
|
||||
nullable: true,
|
||||
},
|
||||
webSizeMultiple: { type: 'number', description: 'Web size multiple', nullable: true },
|
||||
webSizeMultiplePercentile: {
|
||||
type: 'number',
|
||||
description: 'Percentile of the web size multiple',
|
||||
nullable: true,
|
||||
},
|
||||
socialSizeMultiple: { type: 'number', description: 'Social size multiple', nullable: true },
|
||||
socialSizeMultiplePercentile: {
|
||||
type: 'number',
|
||||
description: 'Percentile of the social size multiple',
|
||||
nullable: true,
|
||||
},
|
||||
twitterFollowers: { type: 'number', description: 'Twitter/X follower count', nullable: true },
|
||||
twitterFollowersChange: {
|
||||
type: 'number',
|
||||
description: 'Change in follower count',
|
||||
nullable: true,
|
||||
},
|
||||
twitterFollowersPercentChange: {
|
||||
type: 'number',
|
||||
description: 'Percent change in follower count',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
import type { PitchbookResponse, PitchbookUpdatesParams } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanyUpdatesTool: ToolConfig<PitchbookUpdatesParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_company_updates',
|
||||
name: 'PitchBook Company Updates',
|
||||
description:
|
||||
'Check which company datasets changed in a window, so a sync only refetches what moved',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
sinceDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Window to report changes over, carrying its operator in the value: >YYYY-MM-DD for after a date, <YYYY-MM-DD for before one, or YYYY-MM-DD^YYYY-MM-DD for a range. Use this or trailingRange.',
|
||||
},
|
||||
trailingRange: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Report changes over the last N days. Use this or sinceDate.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.sinceDate) qs.set('sinceDate', params.sinceDate)
|
||||
if (params.trailingRange !== undefined && params.trailingRange !== null) {
|
||||
qs.set('trailingRange', String(params.trailingRange))
|
||||
}
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/updates${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch updates')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
updates: data.updates ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
updates: {
|
||||
type: 'json',
|
||||
description:
|
||||
'Map of dataset name to whether it changed in the window. Keys are PitchBook dataset names, so read it as a plain object.',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCompanyVcExitPredictionsTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_company_vc_exit_predictions',
|
||||
name: 'PitchBook VC Exit Predictions',
|
||||
description:
|
||||
'Retrieve PitchBook machine-learning exit predictions for a VC-backed company. Requires at least two funding rounds in the past six years.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/vc-exit-predictions`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch VC exit predictions')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
companyId: data.companyId ?? null,
|
||||
predictionDate: data.predictionDate ?? null,
|
||||
opportunityScore: data.opportunityScore ?? null,
|
||||
successClass: data.successClass ?? null,
|
||||
successProbability: data.successProbability ?? null,
|
||||
noexitProbability: data.noexitProbability ?? null,
|
||||
exitClass: data.exitClass ?? null,
|
||||
ipoProbability: data.ipoProbability ?? null,
|
||||
mergeracquisitionProbability: data.mergeracquisitionProbability ?? null,
|
||||
vcDealNumber: data.vcDealNumber ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID', nullable: true },
|
||||
predictionDate: {
|
||||
type: 'string',
|
||||
description: 'Date the prediction was generated (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
opportunityScore: {
|
||||
type: 'number',
|
||||
description: 'PitchBook opportunity score',
|
||||
nullable: true,
|
||||
},
|
||||
successClass: {
|
||||
type: 'string',
|
||||
description: 'Predicted outcome class, such as Success',
|
||||
nullable: true,
|
||||
},
|
||||
successProbability: {
|
||||
type: 'number',
|
||||
description: 'Probability of a successful outcome, as a percentage',
|
||||
nullable: true,
|
||||
},
|
||||
noexitProbability: {
|
||||
type: 'number',
|
||||
description: 'Probability of no exit, as a percentage',
|
||||
nullable: true,
|
||||
},
|
||||
exitClass: {
|
||||
type: 'string',
|
||||
description: 'Most likely exit type, such as IPO or M&A',
|
||||
nullable: true,
|
||||
},
|
||||
ipoProbability: {
|
||||
type: 'number',
|
||||
description: 'Probability of an IPO exit, as a percentage',
|
||||
nullable: true,
|
||||
},
|
||||
mergeracquisitionProbability: {
|
||||
type: 'number',
|
||||
description: 'Probability of an M&A exit, as a percentage',
|
||||
nullable: true,
|
||||
},
|
||||
vcDealNumber: {
|
||||
type: 'number',
|
||||
description: 'Number of VC deals the prediction is based on',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
import type { PitchbookContractsHistoryParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookContractsHistoryTool: ToolConfig<
|
||||
PitchbookContractsHistoryParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_contracts_history',
|
||||
name: 'PitchBook Contracts History',
|
||||
description:
|
||||
'Retrieve the API contracts on the account with their pricing model, term, and credit balances',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
activeContract: {
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Set true for only active contracts, false for only past ones. Omit to return every contract.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.activeContract !== undefined && params.activeContract !== null) {
|
||||
qs.set('activeContract', String(params.activeContract))
|
||||
}
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/contracts/history${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch contracts history')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
contracts: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
contracts: {
|
||||
type: 'array',
|
||||
description: 'Contracts on the account',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
contractNumber: { type: 'string', description: 'Contract identifier' },
|
||||
activeContract: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the contract is currently active',
|
||||
},
|
||||
pricingModel: { type: 'string', description: 'Pricing model of the contract' },
|
||||
startDate: { type: 'string', description: 'Start date (YYYY-MM-DD)' },
|
||||
endDate: { type: 'string', description: 'End date (YYYY-MM-DD)', nullable: true },
|
||||
creditsUsed: { type: 'number', description: 'Credits consumed' },
|
||||
creditsChanged: { type: 'number', description: 'Net credits added or removed' },
|
||||
creditsExpired: { type: 'number', description: 'Credits that expired' },
|
||||
creditsRemaining: { type: 'number', description: 'Credits still available' },
|
||||
overageUsed: { type: 'number', description: 'Overage credits consumed' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
import type { PitchbookCostOfCallsParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCostOfCallsTool: ToolConfig<PitchbookCostOfCallsParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_cost_of_calls',
|
||||
name: 'PitchBook Cost of Calls',
|
||||
description:
|
||||
'Retrieve the credit cost of every API endpoint under a given pricing model, for first-time and refresh calls',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pricingModel: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Pricing model to price against: SUBSCRIPTION or PAY_PER_CALL',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.pricingModel) qs.set('pricingModel', params.pricingModel)
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/calls/costs${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch cost of calls')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
costs: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
costs: {
|
||||
type: 'array',
|
||||
description: 'Credit cost per endpoint',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
group: { type: 'string', description: 'Endpoint group' },
|
||||
endpoint: { type: 'string', description: 'Endpoint name' },
|
||||
initialCost: { type: 'number', description: 'Credit cost of a first-time call' },
|
||||
refreshCost: {
|
||||
type: 'number',
|
||||
description: 'Credit cost of re-requesting data already pulled',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
import type { PitchbookResponse, PitchbookUsageWindowParams } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCreditHistoryTool: ToolConfig<PitchbookUsageWindowParams, PitchbookResponse> =
|
||||
{
|
||||
id: 'pitchbook_credit_history',
|
||||
name: 'PitchBook Credit History',
|
||||
description:
|
||||
'Retrieve API credit usage and remaining balance per contract, for up to the last 90 days',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
sinceDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Window to report changes over, carrying its operator in the value: >YYYY-MM-DD for after a date, <YYYY-MM-DD for before one, or YYYY-MM-DD^YYYY-MM-DD for a range. Use this or trailingRange.',
|
||||
},
|
||||
trailingRange: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Report changes over the last N days. Use this or sinceDate.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.sinceDate) qs.set('sinceDate', params.sinceDate)
|
||||
if (params.trailingRange !== undefined && params.trailingRange !== null) {
|
||||
qs.set('trailingRange', String(params.trailingRange))
|
||||
}
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/credits/history${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch credit history')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
credits: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
credits: {
|
||||
type: 'array',
|
||||
description: 'Credit usage per contract over the window',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
contractNumber: { type: 'string', description: 'Contract identifier' },
|
||||
activeContract: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the contract is currently active',
|
||||
},
|
||||
pricingModel: { type: 'string', description: 'Pricing model of the contract' },
|
||||
creditsUsed: { type: 'number', description: 'Credits consumed' },
|
||||
creditsChanged: { type: 'number', description: 'Net credits added or removed' },
|
||||
creditsExpired: { type: 'number', description: 'Credits that expired' },
|
||||
creditsRemaining: { type: 'number', description: 'Credits still available' },
|
||||
overageUsed: { type: 'number', description: 'Overage credits consumed' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCreditNewsTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_credit_news',
|
||||
name: 'PitchBook Credit News Article',
|
||||
description:
|
||||
'Retrieve one credit analysis article in full, including its body text, authors, topics, and the issuer, lender, and sponsor it covers',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Credit news article ID, e.g. 1312103. Article IDs come from a credit news search.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/credit-analysis/credit-news/${params.pbId.trim()}`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch credit news article')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
articleId: data.articleId ?? null,
|
||||
title: data.title ?? null,
|
||||
authors: data.authors ?? [],
|
||||
regions: data.regions ?? [],
|
||||
publishDate: data.publishDate ?? null,
|
||||
assetClasses: data.assetClasses ?? [],
|
||||
topics: data.topics ?? [],
|
||||
issuer: data.issuer ?? null,
|
||||
lender: data.lender ?? null,
|
||||
sponsor: data.sponsor ?? null,
|
||||
articleBody: data.articleBody ?? null,
|
||||
attachments: data.attachments ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
articleId: { type: 'number', description: 'Credit news article ID', nullable: true },
|
||||
title: { type: 'string', description: 'Title', nullable: true },
|
||||
authors: {
|
||||
type: 'array',
|
||||
description: 'Authors of the article',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
authorName: { type: 'string', description: 'Author name' },
|
||||
},
|
||||
},
|
||||
},
|
||||
regions: {
|
||||
type: 'array',
|
||||
description: 'Geographic regions the article covers',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
publishDate: {
|
||||
type: 'string',
|
||||
description: 'Publication timestamp (ISO 8601)',
|
||||
nullable: true,
|
||||
},
|
||||
assetClasses: {
|
||||
type: 'array',
|
||||
description: 'Asset classes the article covers',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
topics: {
|
||||
type: 'array',
|
||||
description: 'Topics the article covers',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
issuer: {
|
||||
type: 'object',
|
||||
description: 'Issuer the article is about',
|
||||
properties: {
|
||||
pbId: { type: 'string', description: 'PitchBook entity ID' },
|
||||
name: { type: 'string', description: 'Name' },
|
||||
},
|
||||
},
|
||||
lender: { type: 'json', description: 'Lender the article is about', nullable: true },
|
||||
sponsor: { type: 'json', description: 'Sponsor the article is about', nullable: true },
|
||||
articleBody: { type: 'string', description: 'Full text of the article', nullable: true },
|
||||
attachments: {
|
||||
type: 'array',
|
||||
description: 'Attachments on the article',
|
||||
items: { type: 'json' },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
import type { PitchbookCreditNewsBulkParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCreditNewsBulkTool: ToolConfig<
|
||||
PitchbookCreditNewsBulkParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_credit_news_bulk',
|
||||
name: 'PitchBook Credit News Bulk',
|
||||
description:
|
||||
'Retrieve many credit analysis articles in full in a single call, reporting which IDs were found, missing, or duplicated',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
articleIds: {
|
||||
type: 'array',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Credit news article IDs to fetch, e.g. [11041384, 2142401]',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/credit-analysis/credit-news`,
|
||||
method: 'POST',
|
||||
headers: (params) => ({
|
||||
...pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
'Content-Type': 'application/json',
|
||||
}),
|
||||
body: (params) => ({
|
||||
items: (params.articleIds ?? []).map((articleId) => ({ articleId: Number(articleId) })),
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch credit news articles')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stats: data.stats ?? null,
|
||||
found: data.found ?? [],
|
||||
notFound: data.notFound ?? [],
|
||||
duplicates: data.duplicates ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stats: {
|
||||
type: 'object',
|
||||
description: 'Summary statistics for the response',
|
||||
properties: {
|
||||
total: { type: 'number', description: 'Total number of matching results' },
|
||||
found: { type: 'number', description: 'Articles that were found' },
|
||||
notFound: { type: 'number', description: 'Article IDs that were not found' },
|
||||
duplicates: {
|
||||
type: 'number',
|
||||
description: 'Article IDs that were requested more than once',
|
||||
},
|
||||
},
|
||||
},
|
||||
found: {
|
||||
type: 'array',
|
||||
description: 'Articles that were found',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
articleId: { type: 'number', description: 'Credit news article ID' },
|
||||
title: { type: 'string', description: 'Title' },
|
||||
authors: {
|
||||
type: 'array',
|
||||
description: 'Authors of the article',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
authorName: { type: 'string', description: 'Author name' },
|
||||
},
|
||||
},
|
||||
},
|
||||
regions: {
|
||||
type: 'array',
|
||||
description: 'Geographic regions the article covers',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
publishDate: { type: 'string', description: 'Publication timestamp (ISO 8601)' },
|
||||
assetClasses: {
|
||||
type: 'array',
|
||||
description: 'Asset classes the article covers',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
topics: {
|
||||
type: 'array',
|
||||
description: 'Topics the article covers',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
issuer: {
|
||||
type: 'object',
|
||||
description: 'Issuer the article is about',
|
||||
nullable: true,
|
||||
properties: {
|
||||
pbId: { type: 'string', description: 'PitchBook entity ID' },
|
||||
name: { type: 'string', description: 'Name' },
|
||||
},
|
||||
},
|
||||
lender: { type: 'json', description: 'Lender the article is about', nullable: true },
|
||||
sponsor: { type: 'json', description: 'Sponsor the article is about', nullable: true },
|
||||
articleBody: { type: 'string', description: 'Full text of the article' },
|
||||
attachments: {
|
||||
type: 'array',
|
||||
description: 'Attachments on the article',
|
||||
items: { type: 'json' },
|
||||
},
|
||||
deal: {
|
||||
type: 'object',
|
||||
description: 'Deal the record belongs to',
|
||||
nullable: true,
|
||||
properties: {
|
||||
dealId: { type: 'string', description: 'PitchBook deal ID' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
notFound: {
|
||||
type: 'array',
|
||||
description: 'Article IDs that were not found',
|
||||
items: { type: 'json' },
|
||||
},
|
||||
duplicates: {
|
||||
type: 'array',
|
||||
description: 'Article IDs that were requested more than once',
|
||||
items: { type: 'json' },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
import type { PitchbookCreditNewsRecentParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import {
|
||||
mapStats,
|
||||
PITCHBOOK_API_BASE,
|
||||
pitchbookAuthHeaders,
|
||||
throwIfNotOk,
|
||||
} from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCreditNewsMostRecentTool: ToolConfig<
|
||||
PitchbookCreditNewsRecentParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_credit_news_most_recent',
|
||||
name: 'PitchBook Most Recent Credit News',
|
||||
description:
|
||||
'Retrieve the most recently published credit analysis articles and their descriptions, without article bodies',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
page: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Page of results to return, starting at 1. Increment it to reach older articles.',
|
||||
},
|
||||
perPage: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'How many results to return per page, between 1 and 250. Defaults to 25.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.page !== undefined && params.page !== null) qs.set('page', String(params.page))
|
||||
if (params.perPage !== undefined && params.perPage !== null) {
|
||||
qs.set('perPage', String(params.perPage))
|
||||
}
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/credit-analysis/credit-news/most-recent${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch most recent credit news')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stats: mapStats(data.stats),
|
||||
items: data.items ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stats: {
|
||||
type: 'object',
|
||||
description: 'Summary statistics for the response',
|
||||
properties: {
|
||||
total: { type: 'number', description: 'Total number of matching results' },
|
||||
perPage: { type: 'number', description: 'Results returned per page' },
|
||||
page: { type: 'number', description: 'Current page number' },
|
||||
lastPage: { type: 'number', description: 'Number of the last available page' },
|
||||
},
|
||||
},
|
||||
items: {
|
||||
type: 'array',
|
||||
description: 'Records returned',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
articleId: { type: 'number', description: 'Credit news article ID' },
|
||||
title: { type: 'string', description: 'Title' },
|
||||
authors: {
|
||||
type: 'array',
|
||||
description: 'Authors of the article',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
authorName: { type: 'string', description: 'Author name' },
|
||||
},
|
||||
},
|
||||
},
|
||||
regions: {
|
||||
type: 'array',
|
||||
description: 'Geographic regions the article covers',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
publishDate: { type: 'string', description: 'Publication timestamp (ISO 8601)' },
|
||||
assetClasses: {
|
||||
type: 'array',
|
||||
description: 'Asset classes the article covers',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
topics: {
|
||||
type: 'array',
|
||||
description: 'Topics the article covers',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
issuer: {
|
||||
type: 'object',
|
||||
description: 'Issuer the article is about',
|
||||
nullable: true,
|
||||
properties: {
|
||||
pbId: { type: 'string', description: 'PitchBook entity ID' },
|
||||
name: { type: 'string', description: 'Name' },
|
||||
},
|
||||
},
|
||||
lender: {
|
||||
type: 'object',
|
||||
description: 'Lender the article is about',
|
||||
nullable: true,
|
||||
properties: {
|
||||
pbId: { type: 'string', description: 'PitchBook entity ID' },
|
||||
name: { type: 'string', description: 'Name' },
|
||||
},
|
||||
},
|
||||
sponsor: {
|
||||
type: 'object',
|
||||
description: 'Sponsor the article is about',
|
||||
nullable: true,
|
||||
properties: {
|
||||
pbId: { type: 'string', description: 'PitchBook entity ID' },
|
||||
name: { type: 'string', description: 'Name' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
import type { PitchbookCreditNewsSearchParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import {
|
||||
mapStats,
|
||||
PITCHBOOK_API_BASE,
|
||||
pitchbookAuthHeaders,
|
||||
throwIfNotOk,
|
||||
} from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookCreditNewsSearchTool: ToolConfig<
|
||||
PitchbookCreditNewsSearchParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_credit_news_search',
|
||||
name: 'PitchBook Credit News Search',
|
||||
description:
|
||||
'Search PitchBook credit analysis news by author, region, asset class, topic, issuer, lender, sponsor, and date',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
authors: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Article author name. Separate multiple values with a comma.',
|
||||
},
|
||||
regions: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Region the article covers: United States or Europe.',
|
||||
},
|
||||
assetClasses: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Asset class the article covers. Separate multiple values with a comma.',
|
||||
},
|
||||
topics: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Topic the article covers. Separate multiple values with a comma.',
|
||||
},
|
||||
issuer: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Issuer name. Separate multiple values with a comma.',
|
||||
},
|
||||
lender: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Lender name. Separate multiple values with a comma.',
|
||||
},
|
||||
sponsor: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Sponsor name. Separate multiple values with a comma.',
|
||||
},
|
||||
sinceDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Publication date filter. Use >YYYY-MM-DD, <YYYY-MM-DD, or YYYY-MM-DD^YYYY-MM-DD for a range.',
|
||||
},
|
||||
page: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Page of results to return, starting at 1',
|
||||
},
|
||||
perPage: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'How many results to return per page, between 1 and 250. Defaults to 25.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.authors) qs.set('authors', params.authors)
|
||||
if (params.regions) qs.set('regions', params.regions)
|
||||
if (params.assetClasses) qs.set('assetClasses', params.assetClasses)
|
||||
if (params.topics) qs.set('topics', params.topics)
|
||||
if (params.issuer) qs.set('issuer', params.issuer)
|
||||
if (params.lender) qs.set('lender', params.lender)
|
||||
if (params.sponsor) qs.set('sponsor', params.sponsor)
|
||||
if (params.sinceDate) qs.set('sinceDate', params.sinceDate)
|
||||
if (params.page !== undefined && params.page !== null) qs.set('page', String(params.page))
|
||||
if (params.perPage !== undefined && params.perPage !== null) {
|
||||
qs.set('perPage', String(params.perPage))
|
||||
}
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/credit-analysis/credit-news/search${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to search credit news')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stats: mapStats(data.stats),
|
||||
items: data.items ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stats: {
|
||||
type: 'object',
|
||||
description: 'Summary statistics for the response',
|
||||
properties: {
|
||||
total: { type: 'number', description: 'Total number of matching results' },
|
||||
perPage: { type: 'number', description: 'Results returned per page' },
|
||||
page: { type: 'number', description: 'Current page number' },
|
||||
lastPage: { type: 'number', description: 'Number of the last available page' },
|
||||
},
|
||||
},
|
||||
items: {
|
||||
type: 'array',
|
||||
description: 'Records returned',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
articleId: { type: 'number', description: 'Credit news article ID' },
|
||||
title: { type: 'string', description: 'Title' },
|
||||
authors: {
|
||||
type: 'array',
|
||||
description: 'Authors of the article',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
authorName: { type: 'string', description: 'Author name' },
|
||||
},
|
||||
},
|
||||
},
|
||||
regions: {
|
||||
type: 'array',
|
||||
description: 'Geographic regions the article covers',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
publishDate: { type: 'string', description: 'Publication timestamp (ISO 8601)' },
|
||||
assetClasses: {
|
||||
type: 'array',
|
||||
description: 'Asset classes the article covers',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
topics: {
|
||||
type: 'array',
|
||||
description: 'Topics the article covers',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
issuer: {
|
||||
type: 'object',
|
||||
description: 'Issuer the article is about',
|
||||
nullable: true,
|
||||
properties: {
|
||||
pbId: { type: 'string', description: 'PitchBook entity ID' },
|
||||
name: { type: 'string', description: 'Name' },
|
||||
},
|
||||
},
|
||||
lender: {
|
||||
type: 'object',
|
||||
description: 'Lender the article is about',
|
||||
nullable: true,
|
||||
properties: {
|
||||
pbId: { type: 'string', description: 'PitchBook entity ID' },
|
||||
name: { type: 'string', description: 'Name' },
|
||||
},
|
||||
},
|
||||
sponsor: {
|
||||
type: 'object',
|
||||
description: 'Sponsor the article is about',
|
||||
nullable: true,
|
||||
properties: {
|
||||
pbId: { type: 'string', description: 'PitchBook entity ID' },
|
||||
name: { type: 'string', description: 'Name' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookDealBioTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_deal_bio',
|
||||
name: 'PitchBook Deal Bio',
|
||||
description:
|
||||
'Retrieve the summary of a deal: company, date, size, status, type, and which detail datasets are available for it',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook deal ID, e.g. 52721-65T. Deal IDs end in T and come from a deal search or a company deals lookup.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/deals/${params.pbId.trim()}/bio`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch deal bio')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
dealId: data.dealId ?? null,
|
||||
dealNumber: data.dealNumber ?? null,
|
||||
companyId: data.companyId ?? null,
|
||||
companyName: data.companyName ?? null,
|
||||
dealAnnouncedDate: data.dealAnnouncedDate ?? null,
|
||||
dealDate: data.dealDate ?? null,
|
||||
dealSize: data.dealSize ?? null,
|
||||
dealSizeStatus: data.dealSizeStatus ?? null,
|
||||
dealStatus: data.dealStatus ?? null,
|
||||
dealType1: data.dealType1 ?? null,
|
||||
dealType2: data.dealType2 ?? null,
|
||||
dealType3: data.dealType3 ?? null,
|
||||
dealClass: data.dealClass ?? null,
|
||||
valuationAvailable: data.valuationAvailable ?? false,
|
||||
capTableAvailable: data.capTableAvailable ?? false,
|
||||
trancheInfoAvailable: data.trancheInfoAvailable ?? false,
|
||||
debtLenderInfoAvailable: data.debtLenderInfoAvailable ?? false,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
dealId: { type: 'string', description: 'PitchBook deal ID', nullable: true },
|
||||
dealNumber: {
|
||||
type: 'number',
|
||||
description: 'Sequence of this deal in the company financing history',
|
||||
nullable: true,
|
||||
},
|
||||
companyId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the company in the deal',
|
||||
nullable: true,
|
||||
},
|
||||
companyName: { type: 'string', description: 'Name of the company in the deal', nullable: true },
|
||||
dealAnnouncedDate: {
|
||||
type: 'string',
|
||||
description: 'Date the deal was announced (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
dealDate: { type: 'string', description: 'Date the deal closed (YYYY-MM-DD)', nullable: true },
|
||||
dealSize: {
|
||||
type: 'object',
|
||||
description: 'Size of the deal',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
dealSizeStatus: {
|
||||
type: 'string',
|
||||
description: 'Whether the deal size is actual or estimated',
|
||||
nullable: true,
|
||||
},
|
||||
dealStatus: {
|
||||
type: 'object',
|
||||
description: 'Status of the deal, such as Completed',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
dealType1: {
|
||||
type: 'object',
|
||||
description: 'Primary deal type',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
dealType2: {
|
||||
type: 'object',
|
||||
description: 'Secondary deal type, such as the round letter',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
dealType3: {
|
||||
type: 'object',
|
||||
description: 'Tertiary deal type',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
dealClass: {
|
||||
type: 'object',
|
||||
description: 'Deal class, such as Venture Capital',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
valuationAvailable: {
|
||||
type: 'boolean',
|
||||
description: 'Whether valuation data exists for this deal',
|
||||
},
|
||||
capTableAvailable: {
|
||||
type: 'boolean',
|
||||
description: 'Whether cap table history exists for this deal',
|
||||
},
|
||||
trancheInfoAvailable: {
|
||||
type: 'boolean',
|
||||
description: 'Whether tranche information exists for this deal',
|
||||
},
|
||||
debtLenderInfoAvailable: {
|
||||
type: 'boolean',
|
||||
description: 'Whether debt and lender information exists for this deal',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookDealCapTableHistoryTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_deal_cap_table_history',
|
||||
name: 'PitchBook Deal Cap Table History',
|
||||
description:
|
||||
'Retrieve the cap table as of a deal, one row per stock series with its terms and ownership',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook deal ID, e.g. 52721-65T. Deal IDs end in T.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/deals/${params.pbId.trim()}/cap-table-history`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch deal cap table history')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
capTable: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
capTable: {
|
||||
type: 'array',
|
||||
description: 'Stock series on the cap table as of the deal',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
dealId: { type: 'string', description: 'PitchBook deal ID' },
|
||||
dealNumber: {
|
||||
type: 'number',
|
||||
description: 'Sequence of the deal in the company financing history',
|
||||
},
|
||||
companyId: { type: 'string', description: 'PitchBook company ID' },
|
||||
companyName: { type: 'string', description: 'Company name' },
|
||||
stockSeries: { type: 'string', description: 'Stock series' },
|
||||
numberOfSharesAuthorized: { type: 'number', description: 'Shares authorized' },
|
||||
parValue: {
|
||||
type: 'object',
|
||||
description: 'Par value per share',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
dividendRate: { type: 'number', description: 'Dividend rate' },
|
||||
dividendAmount: { type: 'json', description: 'Dividend amount', nullable: true },
|
||||
originalIssuePrice: {
|
||||
type: 'object',
|
||||
description: 'Original issue price per share',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
liquidationPrice: {
|
||||
type: 'object',
|
||||
description: 'Liquidation price per share',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
liquidationPreferenceMultiple: {
|
||||
type: 'number',
|
||||
description: 'Liquidation preference multiple',
|
||||
},
|
||||
conversionPrice: {
|
||||
type: 'object',
|
||||
description: 'Conversion price per share',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
percentOwned: { type: 'number', description: 'Percentage owned' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookDealDebtLendersTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_deal_debt_lenders',
|
||||
name: 'PitchBook Deal Debt and Lenders',
|
||||
description:
|
||||
'Retrieve the debt raised in a deal and the lenders behind it, with rate, maturity, seniority, and covenant terms',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook deal ID, e.g. 52721-65T. Deal IDs end in T.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/deals/${params.pbId.trim()}/debt-lenders`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch deal debt and lenders')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
dealId: data.dealId ?? null,
|
||||
dealNumber: data.dealNumber ?? null,
|
||||
company: data.company ?? null,
|
||||
debts: data.debts ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
dealId: { type: 'string', description: 'PitchBook deal ID', nullable: true },
|
||||
dealNumber: {
|
||||
type: 'number',
|
||||
description: 'Sequence of the deal in the company financing history',
|
||||
nullable: true,
|
||||
},
|
||||
company: {
|
||||
type: 'object',
|
||||
description: 'Company the record belongs to',
|
||||
properties: {
|
||||
id: { type: 'string', description: 'PitchBook person ID' },
|
||||
name: { type: 'string', description: 'Name' },
|
||||
},
|
||||
},
|
||||
debts: {
|
||||
type: 'array',
|
||||
description: 'Debt instruments in the deal',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
debtSize: { type: 'json', description: 'Size of the debt instrument', nullable: true },
|
||||
paymentInKind: {
|
||||
type: 'json',
|
||||
description: 'Whether interest is paid in kind',
|
||||
nullable: true,
|
||||
},
|
||||
debtType: {
|
||||
type: 'object',
|
||||
description: 'Type of debt',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
seniority: { type: 'json', description: 'Seniority of the debt', nullable: true },
|
||||
security: { type: 'json', description: 'Security backing the debt', nullable: true },
|
||||
subordination: { type: 'json', description: 'Subordination terms', nullable: true },
|
||||
term: { type: 'json', description: 'Term of the debt', nullable: true },
|
||||
additionalDebtCharacteristics: {
|
||||
type: 'object',
|
||||
description: 'Other characteristics of the debt',
|
||||
properties: {
|
||||
unitranche: { type: 'boolean', description: 'Whether the debt is unitranche' },
|
||||
syndicated: { type: 'boolean', description: 'Whether the debt is syndicated' },
|
||||
mezzanine: { type: 'boolean', description: 'Whether the debt is mezzanine' },
|
||||
covLite: { type: 'boolean', description: 'Whether the debt is covenant-lite' },
|
||||
warrants: { type: 'boolean', description: 'Whether warrants are attached' },
|
||||
convertible: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the instrument is convertible',
|
||||
},
|
||||
rate: { type: 'json', description: 'Interest rate', nullable: true },
|
||||
},
|
||||
},
|
||||
maturityDate: { type: 'json', description: 'Maturity date (YYYY-MM-DD)', nullable: true },
|
||||
spreadInterestRate: {
|
||||
type: 'json',
|
||||
description: 'Spread over the reference interest rate',
|
||||
nullable: true,
|
||||
},
|
||||
lenders: {
|
||||
type: 'array',
|
||||
description: 'Lenders on the debt',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
lenderId: { type: 'string', description: 'PitchBook ID of the lender' },
|
||||
lenderName: { type: 'string', description: 'Name of the lender' },
|
||||
firmType: { type: 'string', description: 'Type of the associated firm' },
|
||||
serviceProviderType: {
|
||||
type: 'object',
|
||||
description: 'Service provider type',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
},
|
||||
},
|
||||
},
|
||||
lenderSize: {
|
||||
type: 'json',
|
||||
description: 'Amount provided by the lender',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,395 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookDealDetailedTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_deal_detailed',
|
||||
name: 'PitchBook Deal Detailed',
|
||||
description:
|
||||
'Retrieve the full detail of a deal: synopsis, percent acquired, round, invested capital, ownership, debt, and stock split',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook deal ID, e.g. 52721-65T. Deal IDs end in T and come from a deal search or a company deals lookup.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/deals/${params.pbId.trim()}/detailed`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch deal detail')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
dealId: data.dealId ?? null,
|
||||
dealNumber: data.dealNumber ?? null,
|
||||
companyId: data.companyId ?? null,
|
||||
companyName: data.companyName ?? null,
|
||||
dealDate: data.dealDate ?? null,
|
||||
dealSize: data.dealSize ?? null,
|
||||
dealSizeStatus: data.dealSizeStatus ?? null,
|
||||
dealStatus: data.dealStatus ?? null,
|
||||
percentAcquired: data.percentAcquired ?? null,
|
||||
raisedToDate: data.raisedToDate ?? null,
|
||||
vcRound: data.vcRound ?? null,
|
||||
vcRoundUpDownFlat: data.vcRoundUpDownFlat ?? null,
|
||||
totalInvestedCapital: data.totalInvestedCapital ?? null,
|
||||
investorOwnership: data.investorOwnership ?? null,
|
||||
stockSplit: data.stockSplit ?? null,
|
||||
dealType1: data.dealType1 ?? null,
|
||||
dealType2: data.dealType2 ?? null,
|
||||
dealType3: data.dealType3 ?? null,
|
||||
dealClass: data.dealClass ?? null,
|
||||
dealSynopsis: data.dealSynopsis ?? null,
|
||||
totalInvestedEquity: data.totalInvestedEquity ?? null,
|
||||
debtType1: data.debtType1 ?? null,
|
||||
debtType2: data.debtType2 ?? null,
|
||||
debtType3: data.debtType3 ?? null,
|
||||
debtAmount1: data.debtAmount1 ?? null,
|
||||
debtAmount2: data.debtAmount2 ?? null,
|
||||
debtAmount3: data.debtAmount3 ?? null,
|
||||
debtRaisedInRound: data.debtRaisedInRound ?? null,
|
||||
contingentPayout: data.contingentPayout ?? null,
|
||||
valuationAvailable: data.valuationAvailable ?? false,
|
||||
capTableAvailable: data.capTableAvailable ?? false,
|
||||
trancheInfoAvailable: data.trancheInfoAvailable ?? false,
|
||||
debtLenderInfoAvailable: data.debtLenderInfoAvailable ?? false,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
dealId: { type: 'string', description: 'PitchBook deal ID', nullable: true },
|
||||
dealNumber: {
|
||||
type: 'number',
|
||||
description: 'Sequence of this deal in the company financing history',
|
||||
nullable: true,
|
||||
},
|
||||
companyId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the company in the deal',
|
||||
nullable: true,
|
||||
},
|
||||
companyName: { type: 'string', description: 'Name of the company in the deal', nullable: true },
|
||||
dealDate: { type: 'string', description: 'Date the deal closed (YYYY-MM-DD)', nullable: true },
|
||||
dealSize: {
|
||||
type: 'object',
|
||||
description: 'Size of the deal',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
dealSizeStatus: {
|
||||
type: 'string',
|
||||
description: 'Whether the deal size is actual or estimated',
|
||||
nullable: true,
|
||||
},
|
||||
dealStatus: {
|
||||
type: 'object',
|
||||
description: 'Status of the deal, such as Completed',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
percentAcquired: {
|
||||
type: 'number',
|
||||
description: 'Percentage of the company acquired in the deal',
|
||||
nullable: true,
|
||||
},
|
||||
raisedToDate: {
|
||||
type: 'object',
|
||||
description: 'Total the company had raised as of this deal',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
vcRound: {
|
||||
type: 'string',
|
||||
description: 'Venture round label, such as 1st Round',
|
||||
nullable: true,
|
||||
},
|
||||
vcRoundUpDownFlat: {
|
||||
type: 'string',
|
||||
description: 'Whether the round was up, down, or flat versus the previous one',
|
||||
nullable: true,
|
||||
},
|
||||
totalInvestedCapital: {
|
||||
type: 'object',
|
||||
description: 'Total capital invested in the deal',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
investorOwnership: {
|
||||
type: 'number',
|
||||
description: 'Percentage of the company owned by investors after the deal',
|
||||
nullable: true,
|
||||
},
|
||||
stockSplit: {
|
||||
type: 'string',
|
||||
description: 'Stock split applied at the deal, such as 1:1',
|
||||
nullable: true,
|
||||
},
|
||||
dealType1: {
|
||||
type: 'object',
|
||||
description: 'Primary deal type',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
dealType2: {
|
||||
type: 'object',
|
||||
description: 'Secondary deal type, such as the round letter',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
dealType3: {
|
||||
type: 'object',
|
||||
description: 'Tertiary deal type',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
dealClass: {
|
||||
type: 'object',
|
||||
description: 'Deal class, such as Venture Capital',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
dealSynopsis: { type: 'string', description: 'Narrative summary of the deal', nullable: true },
|
||||
totalInvestedEquity: {
|
||||
type: 'object',
|
||||
description: 'Total equity invested in the deal',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
debtType1: {
|
||||
type: 'object',
|
||||
description: 'Primary debt type raised in the deal',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
debtType2: {
|
||||
type: 'object',
|
||||
description: 'Secondary debt type raised in the deal',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
debtType3: {
|
||||
type: 'object',
|
||||
description: 'Tertiary debt type raised in the deal',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
debtAmount1: {
|
||||
type: 'object',
|
||||
description: 'Amount of the primary debt type',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
debtAmount2: {
|
||||
type: 'object',
|
||||
description: 'Amount of the secondary debt type',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
debtAmount3: {
|
||||
type: 'object',
|
||||
description: 'Amount of the tertiary debt type',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
debtRaisedInRound: {
|
||||
type: 'object',
|
||||
description: 'Total debt raised in the round',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
contingentPayout: {
|
||||
type: 'object',
|
||||
description: 'Contingent payout attached to the deal',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
valuationAvailable: {
|
||||
type: 'boolean',
|
||||
description: 'Whether valuation data exists for this deal',
|
||||
},
|
||||
capTableAvailable: {
|
||||
type: 'boolean',
|
||||
description: 'Whether cap table history exists for this deal',
|
||||
},
|
||||
trancheInfoAvailable: {
|
||||
type: 'boolean',
|
||||
description: 'Whether tranche information exists for this deal',
|
||||
},
|
||||
debtLenderInfoAvailable: {
|
||||
type: 'boolean',
|
||||
description: 'Whether debt and lender information exists for this deal',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookDealInvestorsTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_deal_investors',
|
||||
name: 'PitchBook Deal Investors',
|
||||
description:
|
||||
'Retrieve the investors, sellers, and exiting investors on a deal, including who led it',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook deal ID, e.g. 52721-65T. Deal IDs end in T and come from a deal search or a company deals lookup.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/deals/${params.pbId.trim()}/investors/exiters`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch deal investors')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
dealId: data.dealId ?? null,
|
||||
companyId: data.companyId ?? null,
|
||||
companyName: data.companyName ?? null,
|
||||
investors: data.investors ?? [],
|
||||
sellers: data.sellers ?? [],
|
||||
exiters: data.exiters ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
dealId: { type: 'string', description: 'PitchBook deal ID', nullable: true },
|
||||
companyId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the company in the deal',
|
||||
nullable: true,
|
||||
},
|
||||
companyName: { type: 'string', description: 'Name of the company in the deal', nullable: true },
|
||||
investors: {
|
||||
type: 'array',
|
||||
description: 'Investors participating in the deal',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID' },
|
||||
investorName: { type: 'string', description: 'Investor name' },
|
||||
investmentStatus: {
|
||||
type: 'string',
|
||||
description: 'Whether the investor is new or following on',
|
||||
nullable: true,
|
||||
},
|
||||
leadSoleInvestor: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the investor led or solely funded the round',
|
||||
},
|
||||
leadPartnerId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook person ID of the lead partner',
|
||||
nullable: true,
|
||||
},
|
||||
leadPartnerName: {
|
||||
type: 'string',
|
||||
description: 'Name of the lead partner',
|
||||
nullable: true,
|
||||
},
|
||||
investorFunds: {
|
||||
type: 'array',
|
||||
description: 'Funds the investor deployed into the deal',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID' },
|
||||
fundName: { type: 'string', description: 'Fund name' },
|
||||
},
|
||||
},
|
||||
},
|
||||
investmentAmount: {
|
||||
type: 'object',
|
||||
description: 'Amount this investor put into the deal',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: {
|
||||
type: 'number',
|
||||
description: 'Value in the requested currency',
|
||||
nullable: true,
|
||||
},
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: {
|
||||
type: 'string',
|
||||
description: 'Currency of nativeAmount',
|
||||
nullable: true,
|
||||
},
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
formOfPayment: {
|
||||
type: 'object',
|
||||
description: 'How the investment was paid',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Payment form code', nullable: true },
|
||||
description: { type: 'string', description: 'Payment form label', nullable: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
sellers: {
|
||||
type: 'array',
|
||||
description: 'Parties selling in the deal',
|
||||
items: { type: 'object' },
|
||||
},
|
||||
exiters: {
|
||||
type: 'array',
|
||||
description: 'Investors exiting through the deal',
|
||||
items: { type: 'object' },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookDealMultiplesTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_deal_multiples',
|
||||
name: 'PitchBook Deal Multiples',
|
||||
description:
|
||||
'Retrieve the valuation multiples for a deal against revenue, EBITDA, EBIT, cash flow, and net income',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook deal ID, e.g. 52721-65T. Deal IDs end in T.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/deals/${params.pbId.trim()}/multiples`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch deal multiples')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
dealId: data.dealId ?? null,
|
||||
dealNumber: data.dealNumber ?? null,
|
||||
companyId: data.companyId ?? null,
|
||||
companyName: data.companyName ?? null,
|
||||
dealSizeToCashFlow: data.dealSizeToCashFlow ?? null,
|
||||
dealSizeToEBIT: data.dealSizeToEBIT ?? null,
|
||||
dealSizeToEBITDA: data.dealSizeToEBITDA ?? null,
|
||||
dealSizeToNetIncome: data.dealSizeToNetIncome ?? null,
|
||||
dealSizeToRevenue: data.dealSizeToRevenue ?? null,
|
||||
debtRaisedInRoundToEBITDA: data.debtRaisedInRoundToEBITDA ?? null,
|
||||
debtRaisedInRoundToEquity: data.debtRaisedInRoundToEquity ?? null,
|
||||
impliedEvToCashFlow: data.impliedEvToCashFlow ?? null,
|
||||
impliedEvToEBIT: data.impliedEvToEBIT ?? null,
|
||||
impliedEvToEBITDA: data.impliedEvToEBITDA ?? null,
|
||||
impliedEvToNetIncome: data.impliedEvToNetIncome ?? null,
|
||||
impliedEvToRevenue: data.impliedEvToRevenue ?? null,
|
||||
valuationToCashFlow: data.valuationToCashFlow ?? null,
|
||||
valuationToEBIT: data.valuationToEBIT ?? null,
|
||||
valuationToEBITDA: data.valuationToEBITDA ?? null,
|
||||
valuationToNetIncome: data.valuationToNetIncome ?? null,
|
||||
valuationToRevenue: data.valuationToRevenue ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
dealId: { type: 'string', description: 'PitchBook deal ID', nullable: true },
|
||||
dealNumber: {
|
||||
type: 'number',
|
||||
description: 'Sequence of the deal in the company financing history',
|
||||
nullable: true,
|
||||
},
|
||||
companyId: { type: 'string', description: 'PitchBook company ID', nullable: true },
|
||||
companyName: { type: 'string', description: 'Company name', nullable: true },
|
||||
dealSizeToCashFlow: { type: 'number', description: 'Deal size to cash flow', nullable: true },
|
||||
dealSizeToEBIT: { type: 'number', description: 'Deal size to EBIT', nullable: true },
|
||||
dealSizeToEBITDA: { type: 'number', description: 'Deal size to EBITDA', nullable: true },
|
||||
dealSizeToNetIncome: { type: 'json', description: 'Deal size to net income', nullable: true },
|
||||
dealSizeToRevenue: { type: 'number', description: 'Deal size to revenue', nullable: true },
|
||||
debtRaisedInRoundToEBITDA: {
|
||||
type: 'json',
|
||||
description: 'Debt raised in round to EBITDA',
|
||||
nullable: true,
|
||||
},
|
||||
debtRaisedInRoundToEquity: {
|
||||
type: 'json',
|
||||
description: 'Debt raised in round to equity',
|
||||
nullable: true,
|
||||
},
|
||||
impliedEvToCashFlow: { type: 'number', description: 'Implied EV to cash flow', nullable: true },
|
||||
impliedEvToEBIT: { type: 'number', description: 'Implied EV to EBIT', nullable: true },
|
||||
impliedEvToEBITDA: { type: 'number', description: 'Implied EV to EBITDA', nullable: true },
|
||||
impliedEvToNetIncome: { type: 'json', description: 'Implied EV to net income', nullable: true },
|
||||
impliedEvToRevenue: { type: 'number', description: 'Implied EV to revenue', nullable: true },
|
||||
valuationToCashFlow: { type: 'number', description: 'Valuation to cash flow', nullable: true },
|
||||
valuationToEBIT: { type: 'number', description: 'Valuation to EBIT', nullable: true },
|
||||
valuationToEBITDA: { type: 'number', description: 'Valuation to EBITDA', nullable: true },
|
||||
valuationToNetIncome: { type: 'json', description: 'Valuation to net income', nullable: true },
|
||||
valuationToRevenue: { type: 'number', description: 'Valuation to revenue', nullable: true },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
import type { PitchbookDealSearchParams, PitchbookSearchResponse } from '@/tools/pitchbook/types'
|
||||
import {
|
||||
buildSearchQuery,
|
||||
mapStats,
|
||||
PITCHBOOK_API_BASE,
|
||||
pitchbookAuthHeaders,
|
||||
throwIfNotOk,
|
||||
} from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookDealSearchTool: ToolConfig<
|
||||
PitchbookDealSearchParams,
|
||||
PitchbookSearchResponse
|
||||
> = {
|
||||
id: 'pitchbook_deal_search',
|
||||
name: 'PitchBook Deal Search',
|
||||
description:
|
||||
'Search PitchBook for deals by company, investor, deal type, size, date, and valuation',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
companyNames: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated company names, PitchBook IDs, websites, or tickers',
|
||||
},
|
||||
investorNames: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated investor names, PitchBook IDs, websites, or tickers',
|
||||
},
|
||||
keywords: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Keywords associated with the companies involved',
|
||||
},
|
||||
country: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Country of the companies involved (e.g. USA)',
|
||||
},
|
||||
locationType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Restrict location matching to HQ_ONLY, NON_HQ_ONLY, or ANY',
|
||||
},
|
||||
industry: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook industry code of the companies involved',
|
||||
},
|
||||
verticals: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook vertical code of the companies involved',
|
||||
},
|
||||
dealType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook deal type code (e.g. evc for early-stage VC)',
|
||||
},
|
||||
dealStatus: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Deal status code, distinguishing completed, failed, and upcoming deals',
|
||||
},
|
||||
dealSize: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Deal size in millions. Use >100, <100, or 10^100 for a range',
|
||||
},
|
||||
dealDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Deal date filter. Use >YYYY-MM-DD, <YYYY-MM-DD, or YYYY-MM-DD^YYYY-MM-DD for a range',
|
||||
},
|
||||
postValuation: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Post-money valuation in millions. Use >100, <100, or 10^100 for a range',
|
||||
},
|
||||
revenue: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Revenue of the companies involved in millions. Use >100, <100, or 10^100 for a range',
|
||||
},
|
||||
filterCurrency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code the monetary filters on this search are expressed in, e.g. setting EUR means dealSize is read as millions of euros. Distinct from `currency`, which converts the values PitchBook returns.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
page: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Page of results to return, starting at 1',
|
||||
},
|
||||
perPage: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'How many results to return per page',
|
||||
},
|
||||
additionalFilters: {
|
||||
type: 'json',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Any other documented search filter, as a JSON object of query parameter names to values (e.g. {"emergingSpaces": "AGTECH"}). A dedicated field always wins over the same key set here.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const query = buildSearchQuery(
|
||||
{
|
||||
companyNames: params.companyNames,
|
||||
investorNames: params.investorNames,
|
||||
keywords: params.keywords,
|
||||
country: params.country,
|
||||
locationType: params.locationType,
|
||||
industry: params.industry,
|
||||
verticals: params.verticals,
|
||||
dealType: params.dealType,
|
||||
dealStatus: params.dealStatus,
|
||||
dealSize: params.dealSize,
|
||||
dealDate: params.dealDate,
|
||||
postValuation: params.postValuation,
|
||||
revenue: params.revenue,
|
||||
currency: params.filterCurrency,
|
||||
},
|
||||
{
|
||||
page: params.page,
|
||||
perPage: params.perPage,
|
||||
additionalFilters: params.additionalFilters,
|
||||
}
|
||||
)
|
||||
return `${PITCHBOOK_API_BASE}/deals/search${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to search deals')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stats: mapStats(data.stats),
|
||||
items: data.items ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stats: {
|
||||
type: 'object',
|
||||
description: 'Paging envelope for the result set',
|
||||
properties: {
|
||||
total: { type: 'number', description: 'Total number of matching results' },
|
||||
perPage: { type: 'number', description: 'Results returned per page' },
|
||||
page: { type: 'number', description: 'Current page number' },
|
||||
lastPage: { type: 'number', description: 'Number of the last available page' },
|
||||
},
|
||||
},
|
||||
items: {
|
||||
type: 'array',
|
||||
description: 'Deals matching the search criteria',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
dealId: { type: 'string', description: 'PitchBook deal ID' },
|
||||
companyId: { type: 'string', description: 'PitchBook ID of the company in the deal' },
|
||||
companyName: { type: 'string', description: 'Name of the company in the deal' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookDealServiceProvidersTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_deal_service_providers',
|
||||
name: 'PitchBook Deal Service Providers',
|
||||
description:
|
||||
'Retrieve the service providers that worked on a deal and which party each represented',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook deal ID, e.g. 52721-65T. Deal IDs end in T.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/deals/${params.pbId.trim()}/service-providers`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch deal service providers')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
serviceProviders: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
serviceProviders: {
|
||||
type: 'array',
|
||||
description: 'Service providers that worked on the deal',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
dealId: { type: 'string', description: 'PitchBook deal ID' },
|
||||
companyId: { type: 'string', description: 'PitchBook company ID' },
|
||||
companyName: { type: 'string', description: 'Company name' },
|
||||
serviceProviderId: { type: 'string', description: 'PitchBook service provider ID' },
|
||||
serviceProviderName: { type: 'string', description: 'Service provider name' },
|
||||
serviceProviderTypes: {
|
||||
type: 'array',
|
||||
description: 'Types the service provider is classified as',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
type: {
|
||||
type: 'object',
|
||||
description: 'Type as a code and description pair',
|
||||
properties: {
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
},
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary entry' },
|
||||
},
|
||||
},
|
||||
},
|
||||
serviceProvided: {
|
||||
type: 'object',
|
||||
description: 'Service provided, as a code and description pair',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
serviceProvidedToId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the party the service was provided to',
|
||||
},
|
||||
serviceProvidedToName: {
|
||||
type: 'string',
|
||||
description: 'Name of the party the service was provided to',
|
||||
},
|
||||
leadPartnerId: {
|
||||
type: 'json',
|
||||
description: 'PitchBook person ID of the lead partner',
|
||||
nullable: true,
|
||||
},
|
||||
leadPartnerName: {
|
||||
type: 'json',
|
||||
description: 'Name of the lead partner',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookDealStockInfoTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_deal_stock_info',
|
||||
name: 'PitchBook Deal Stock Info',
|
||||
description:
|
||||
'Retrieve the share terms of a deal: price per share, shares acquired, and the preference, dividend, and voting rights attached',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook deal ID, e.g. 52721-65T. Deal IDs end in T.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/deals/${params.pbId.trim()}/stock-info`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch deal stock info')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
dealId: data.dealId ?? null,
|
||||
dealNumber: data.dealNumber ?? null,
|
||||
companyId: data.companyId ?? null,
|
||||
companyName: data.companyName ?? null,
|
||||
series: data.series ?? null,
|
||||
pricePerShare: data.pricePerShare ?? null,
|
||||
stockType: data.stockType ?? null,
|
||||
numberOfSharesAcquired: data.numberOfSharesAcquired ?? null,
|
||||
sharesSought: data.sharesSought ?? null,
|
||||
conversionRatio: data.conversionRatio ?? null,
|
||||
liquidationPreferences: data.liquidationPreferences ?? null,
|
||||
liquidationParticipating: data.liquidationParticipating ?? null,
|
||||
dividendRights: data.dividendRights ?? null,
|
||||
cumulativeness: data.cumulativeness ?? null,
|
||||
antiDilutionProvisions: data.antiDilutionProvisions ?? null,
|
||||
redemptionRights: data.redemptionRights ?? null,
|
||||
boardVotingRights: data.boardVotingRights ?? null,
|
||||
generalVotingRights: data.generalVotingRights ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
dealId: { type: 'string', description: 'PitchBook deal ID', nullable: true },
|
||||
dealNumber: {
|
||||
type: 'number',
|
||||
description: 'Sequence of the deal in the company financing history',
|
||||
nullable: true,
|
||||
},
|
||||
companyId: { type: 'string', description: 'PitchBook company ID', nullable: true },
|
||||
companyName: { type: 'string', description: 'Company name', nullable: true },
|
||||
series: { type: 'string', description: 'Stock series', nullable: true },
|
||||
pricePerShare: {
|
||||
type: 'object',
|
||||
description: 'Price per share',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
stockType: { type: 'json', description: 'Type of stock', nullable: true },
|
||||
numberOfSharesAcquired: { type: 'number', description: 'Shares acquired', nullable: true },
|
||||
sharesSought: { type: 'number', description: 'Shares sought', nullable: true },
|
||||
conversionRatio: { type: 'string', description: 'Conversion ratio', nullable: true },
|
||||
liquidationPreferences: {
|
||||
type: 'string',
|
||||
description: 'Liquidation preference terms',
|
||||
nullable: true,
|
||||
},
|
||||
liquidationParticipating: {
|
||||
type: 'string',
|
||||
description: 'Whether the preference participates',
|
||||
nullable: true,
|
||||
},
|
||||
dividendRights: { type: 'string', description: 'Dividend rights terms', nullable: true },
|
||||
cumulativeness: {
|
||||
type: 'string',
|
||||
description: 'Whether dividends are cumulative',
|
||||
nullable: true,
|
||||
},
|
||||
antiDilutionProvisions: {
|
||||
type: 'string',
|
||||
description: 'Anti-dilution provisions',
|
||||
nullable: true,
|
||||
},
|
||||
redemptionRights: { type: 'json', description: 'Redemption rights terms', nullable: true },
|
||||
boardVotingRights: { type: 'string', description: 'Board voting rights terms', nullable: true },
|
||||
generalVotingRights: {
|
||||
type: 'string',
|
||||
description: 'General voting rights terms',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookDealTrancheInfoTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_deal_tranche_info',
|
||||
name: 'PitchBook Deal Tranche Info',
|
||||
description:
|
||||
'Retrieve the tranches a deal was funded in, with each tranche date, size, and investors',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook deal ID, e.g. 52721-65T. Deal IDs end in T.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/deals/${params.pbId.trim()}/tranche-info`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch deal tranche information')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
dealId: data.dealId ?? null,
|
||||
dealNumber: data.dealNumber ?? null,
|
||||
company: data.company ?? null,
|
||||
tranches: data.tranches ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
dealId: { type: 'string', description: 'PitchBook deal ID', nullable: true },
|
||||
dealNumber: {
|
||||
type: 'number',
|
||||
description: 'Sequence of the deal in the company financing history',
|
||||
nullable: true,
|
||||
},
|
||||
company: {
|
||||
type: 'object',
|
||||
description: 'Company the record belongs to',
|
||||
properties: {
|
||||
id: { type: 'string', description: 'PitchBook person ID' },
|
||||
name: { type: 'string', description: 'Name' },
|
||||
},
|
||||
},
|
||||
tranches: {
|
||||
type: 'array',
|
||||
description: 'Tranches making up the deal',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
trancheSize: {
|
||||
type: 'object',
|
||||
description: 'Size of the tranche',
|
||||
nullable: true,
|
||||
properties: {
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
},
|
||||
},
|
||||
trancheSizeStatus: {
|
||||
type: 'string',
|
||||
description: 'Whether the tranche size is actual or estimated',
|
||||
},
|
||||
trancheDate: { type: 'string', description: 'Date of the tranche (YYYY-MM-DD)' },
|
||||
financingType: {
|
||||
type: 'object',
|
||||
description: 'Type of financing',
|
||||
properties: {
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
stockType: {
|
||||
type: 'object',
|
||||
description: 'Type of stock',
|
||||
nullable: true,
|
||||
properties: {
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
stockSeriesType: { type: 'string', description: 'Type of the stock series' },
|
||||
conversionStatus: { type: 'json', description: 'Conversion status', nullable: true },
|
||||
conversionDate: {
|
||||
type: 'json',
|
||||
description: 'Conversion date (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
investor: {
|
||||
type: 'object',
|
||||
description: 'Investor on the record',
|
||||
nullable: true,
|
||||
properties: {
|
||||
name: { type: 'string', description: 'Name' },
|
||||
id: { type: 'string', description: 'PitchBook person ID' },
|
||||
},
|
||||
},
|
||||
investor2: {
|
||||
type: 'object',
|
||||
description: 'Second investor on the record',
|
||||
nullable: true,
|
||||
properties: {
|
||||
id: { type: 'string', description: 'PitchBook person ID' },
|
||||
name: { type: 'string', description: 'Name' },
|
||||
},
|
||||
},
|
||||
investor3: {
|
||||
type: 'object',
|
||||
description: 'Third investor on the record',
|
||||
nullable: true,
|
||||
properties: {
|
||||
id: { type: 'string', description: 'PitchBook person ID' },
|
||||
name: { type: 'string', description: 'Name' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
import type { PitchbookResponse, PitchbookUpdatesParams } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookDealUpdatesTool: ToolConfig<PitchbookUpdatesParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_deal_updates',
|
||||
name: 'PitchBook Deal Updates',
|
||||
description: 'Check which deal datasets changed in a window, so a sync only refetches what moved',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook deal ID, e.g. 52721-65T. Deal IDs end in T.',
|
||||
},
|
||||
sinceDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Window to report changes over, carrying its operator in the value: >YYYY-MM-DD for after a date, <YYYY-MM-DD for before one, or YYYY-MM-DD^YYYY-MM-DD for a range. Use this or trailingRange.',
|
||||
},
|
||||
trailingRange: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Report changes over the last N days. Use this or sinceDate.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.sinceDate) qs.set('sinceDate', params.sinceDate)
|
||||
if (params.trailingRange !== undefined && params.trailingRange !== null) {
|
||||
qs.set('trailingRange', String(params.trailingRange))
|
||||
}
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/deals/${params.pbId.trim()}/updates${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch updates')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
updates: data.updates ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
updates: {
|
||||
type: 'json',
|
||||
description:
|
||||
'Map of dataset name to whether it changed in the window. Keys are PitchBook dataset names, so read it as a plain object.',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookDealValuationTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_deal_valuation',
|
||||
name: 'PitchBook Deal Valuation',
|
||||
description: 'Retrieve the pre-money and post-money valuation recorded for a deal',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook deal ID, e.g. 52721-65T. Deal IDs end in T and come from a deal search or a company deals lookup.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/deals/${params.pbId.trim()}/valuation`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch deal valuation')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
dealId: data.dealId ?? null,
|
||||
dealNumber: data.dealNumber ?? null,
|
||||
companyId: data.companyId ?? null,
|
||||
companyName: data.companyName ?? null,
|
||||
preValuation: data.preValuation ?? null,
|
||||
postValuation: data.postValuation ?? null,
|
||||
postValuationStatus: data.postValuationStatus ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
dealId: { type: 'string', description: 'PitchBook deal ID', nullable: true },
|
||||
dealNumber: {
|
||||
type: 'number',
|
||||
description: 'Sequence of this deal in the company financing history',
|
||||
nullable: true,
|
||||
},
|
||||
companyId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the company in the deal',
|
||||
nullable: true,
|
||||
},
|
||||
companyName: { type: 'string', description: 'Name of the company in the deal', nullable: true },
|
||||
preValuation: {
|
||||
type: 'object',
|
||||
description: 'Pre-money valuation',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
postValuation: {
|
||||
type: 'object',
|
||||
description: 'Post-money valuation',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
postValuationStatus: {
|
||||
type: 'string',
|
||||
description: 'Whether the post-money valuation is actual or estimated',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookEntityAffiliatesTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> =
|
||||
{
|
||||
id: 'pitchbook_entity_affiliates',
|
||||
name: 'PitchBook Entity Affiliates',
|
||||
description: 'Retrieve the affiliated entities linked to an entity and how each is related',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook entity ID of a company, investor, or service provider, e.g. 51261-67.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/entities/${params.pbId.trim()}/affiliates`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch entity affiliates')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
affiliates: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
affiliates: {
|
||||
type: 'array',
|
||||
description: 'Entities affiliated with the given entity',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
entityId: { type: 'string', description: 'PitchBook entity ID' },
|
||||
affiliateId: { type: 'string', description: 'PitchBook ID of the affiliate' },
|
||||
affiliateName: { type: 'string', description: 'Name of the affiliate' },
|
||||
affiliateType: { type: 'string', description: 'Relationship to the affiliate' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookEntityLocationsTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_entity_locations',
|
||||
name: 'PitchBook Entity Locations',
|
||||
description: 'Retrieve the headquarters and every alternate office on record for an entity',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook entity ID of a company, investor, or service provider, e.g. 51261-67.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/entities/${params.pbId.trim()}/locations`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch entity locations')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
entityId: data.entityId ?? null,
|
||||
hqOffice: data.hqOffice ?? null,
|
||||
alternateOffices: data.alternateOffices ?? [],
|
||||
alternateOfficesCount: data.alternateOfficesCount ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
entityId: { type: 'string', description: 'PitchBook entity ID', nullable: true },
|
||||
hqOffice: {
|
||||
type: 'object',
|
||||
description: 'Headquarters office',
|
||||
properties: {
|
||||
location: { type: 'string', description: 'Office label' },
|
||||
addressLine1: { type: 'string', description: 'Address line 1' },
|
||||
addressLine2: { type: 'json', description: 'Address line 2', nullable: true },
|
||||
city: { type: 'string', description: 'City' },
|
||||
stateProvince: { type: 'string', description: 'State or province' },
|
||||
postCode: { type: 'string', description: 'Postal code' },
|
||||
country: { type: 'string', description: 'Country' },
|
||||
phone: { type: 'string', description: 'Phone number' },
|
||||
fax: { type: 'json', description: 'Fax number', nullable: true },
|
||||
email: { type: 'string', description: 'Email address' },
|
||||
globalRegion: { type: 'string', description: 'Global region' },
|
||||
globalSubRegion: { type: 'string', description: 'Global sub-region' },
|
||||
},
|
||||
},
|
||||
alternateOffices: {
|
||||
type: 'array',
|
||||
description: 'Other offices on record',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
location: { type: 'string', description: 'Office label' },
|
||||
addressLine1: { type: 'string', description: 'Address line 1', nullable: true },
|
||||
addressLine2: { type: 'string', description: 'Address line 2', nullable: true },
|
||||
city: { type: 'string', description: 'City', nullable: true },
|
||||
stateProvince: { type: 'string', description: 'State or province', nullable: true },
|
||||
postCode: { type: 'string', description: 'Postal code', nullable: true },
|
||||
country: { type: 'string', description: 'Country' },
|
||||
phone: { type: 'json', description: 'Phone number', nullable: true },
|
||||
fax: { type: 'json', description: 'Fax number', nullable: true },
|
||||
email: { type: 'string', description: 'Email address' },
|
||||
globalRegion: { type: 'string', description: 'Global region' },
|
||||
globalSubRegion: { type: 'string', description: 'Global sub-region' },
|
||||
},
|
||||
},
|
||||
},
|
||||
alternateOfficesCount: {
|
||||
type: 'number',
|
||||
description: 'How many other offices are on record',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
import type { PitchbookEntityNewsWindowParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookEntityNewsTool: ToolConfig<
|
||||
PitchbookEntityNewsWindowParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_entity_news',
|
||||
name: 'PitchBook Entity News',
|
||||
description: 'Retrieve recent news articles PitchBook has associated with an entity',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook entity ID of a company, investor, or service provider, e.g. 51261-67.',
|
||||
},
|
||||
sinceDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Publication window, carrying its operator in the value: >YYYY-MM-DD for after a date, <YYYY-MM-DD for before one, or YYYY-MM-DD^YYYY-MM-DD for a range. Use this or trailingRange.',
|
||||
},
|
||||
trailingRange: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'How many days back to pull news for (e.g. 20)',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.sinceDate) qs.set('sinceDate', params.sinceDate.trim())
|
||||
if (params.trailingRange !== undefined && params.trailingRange !== null) {
|
||||
qs.set('trailingRange', String(params.trailingRange))
|
||||
}
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/entities/${params.pbId.trim()}/news${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch entity news')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
news: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
news: {
|
||||
type: 'array',
|
||||
description: 'News articles associated with the entity, most recent first',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
entityId: { type: 'string', description: 'PitchBook entity ID the article is about' },
|
||||
title: { type: 'string', description: 'Article headline' },
|
||||
byline: { type: 'string', description: 'Article summary or byline', nullable: true },
|
||||
source: {
|
||||
type: 'string',
|
||||
description: 'Publication the article came from',
|
||||
nullable: true,
|
||||
},
|
||||
publishDate: {
|
||||
type: 'string',
|
||||
description: 'Publication timestamp (ISO 8601)',
|
||||
nullable: true,
|
||||
},
|
||||
url: { type: 'string', description: 'Link to the article', nullable: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookEntityPeopleTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_entity_people',
|
||||
name: 'PitchBook Entity People',
|
||||
description:
|
||||
'Retrieve the people at an entity: primary contact, current and former team, and current and former board members',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook entity ID of a company, investor, or service provider, e.g. 51261-67.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/entities/${params.pbId.trim()}/people`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch entity people')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
entityId: data.entityId ?? null,
|
||||
primaryContact: data.primaryContact ?? null,
|
||||
currentTeam: data.currentTeam ?? [],
|
||||
formerTeam: data.formerTeam ?? [],
|
||||
currentBoardMembersAndObservers: data.currentBoardMembersAndObservers ?? [],
|
||||
formerBoardMembersAndObservers: data.formerBoardMembersAndObservers ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
entityId: { type: 'string', description: 'PitchBook entity ID', nullable: true },
|
||||
primaryContact: {
|
||||
type: 'object',
|
||||
description: 'Primary contact at the entity',
|
||||
nullable: true,
|
||||
properties: {
|
||||
personId: { type: 'string', description: 'PitchBook person ID', nullable: true },
|
||||
fullName: { type: 'string', description: 'Full name', nullable: true },
|
||||
title: { type: 'string', description: 'Job title', nullable: true },
|
||||
phone: { type: 'string', description: 'Phone number', nullable: true },
|
||||
fax: { type: 'string', description: 'Fax number', nullable: true },
|
||||
email: { type: 'string', description: 'Email address', nullable: true },
|
||||
},
|
||||
},
|
||||
currentTeam: {
|
||||
type: 'array',
|
||||
description: 'People currently working at the entity',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: { type: 'string', description: 'PitchBook person ID' },
|
||||
name: { type: 'string', description: 'Full name' },
|
||||
title: { type: 'string', description: 'Job title', nullable: true },
|
||||
positionStart: {
|
||||
type: 'string',
|
||||
description: 'Date the position started (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
infoAvailable: {
|
||||
type: 'boolean',
|
||||
description: 'Whether a full person profile is available for them',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
formerTeam: {
|
||||
type: 'array',
|
||||
description: 'People who previously worked at the entity',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: { type: 'string', description: 'PitchBook person ID' },
|
||||
name: { type: 'string', description: 'Full name' },
|
||||
title: { type: 'string', description: 'Job title', nullable: true },
|
||||
positionStart: {
|
||||
type: 'string',
|
||||
description: 'Date the position started (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
positionFinish: {
|
||||
type: 'string',
|
||||
description: 'Date the position ended (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
infoAvailable: {
|
||||
type: 'boolean',
|
||||
description: 'Whether a full person profile is available for them',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
currentBoardMembersAndObservers: {
|
||||
type: 'array',
|
||||
description: 'Current board members and observers',
|
||||
items: { type: 'object' },
|
||||
},
|
||||
formerBoardMembersAndObservers: {
|
||||
type: 'array',
|
||||
description: 'Former board members and observers',
|
||||
items: { type: 'object' },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
import type { PitchbookResponse, PitchbookUpdatesParams } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookEntityUpdatesTool: ToolConfig<PitchbookUpdatesParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_entity_updates',
|
||||
name: 'PitchBook Entity Updates',
|
||||
description:
|
||||
'Check which entity datasets changed in a window, so a sync only refetches what moved',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook entity ID of a company, investor, or service provider, e.g. 51261-67.',
|
||||
},
|
||||
sinceDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Window to report changes over, carrying its operator in the value: >YYYY-MM-DD for after a date, <YYYY-MM-DD for before one, or YYYY-MM-DD^YYYY-MM-DD for a range. Use this or trailingRange.',
|
||||
},
|
||||
trailingRange: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Report changes over the last N days. Use this or sinceDate.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.sinceDate) qs.set('sinceDate', params.sinceDate)
|
||||
if (params.trailingRange !== undefined && params.trailingRange !== null) {
|
||||
qs.set('trailingRange', String(params.trailingRange))
|
||||
}
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/entities/${params.pbId.trim()}/updates${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch updates')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
updates: data.updates ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
updates: {
|
||||
type: 'json',
|
||||
description:
|
||||
'Map of dataset name to whether it changed in the window. Keys are PitchBook dataset names, so read it as a plain object.',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookFundActiveInvestmentsTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_fund_active_investments',
|
||||
name: 'PitchBook Fund Active Investments',
|
||||
description: 'Retrieve only the portfolio positions a fund still holds',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook fund ID, e.g. 11373-13F. Fund IDs end in F.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/funds/${params.pbId.trim()}/active-investments`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch fund active investments')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
activeInvestments: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
activeInvestments: {
|
||||
type: 'array',
|
||||
description: 'Portfolio positions the fund still holds',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID' },
|
||||
targetCompanyId: { type: 'string', description: 'PitchBook ID of the portfolio company' },
|
||||
targetCompanyName: { type: 'string', description: 'Name of the portfolio company' },
|
||||
targetCompanyInvestmentDate: {
|
||||
type: 'string',
|
||||
description: 'Date the position was opened (YYYY-MM-DD)',
|
||||
},
|
||||
investmentDealId: { type: 'string', description: 'PitchBook deal ID of the investment' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookFundBenchmarkTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_fund_benchmark',
|
||||
name: 'PitchBook Fund Benchmark',
|
||||
description:
|
||||
'Retrieve the peer benchmark for a fund: benchmark IRR, DPI, TVPI, RVPI, and the funds it is drawn from',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook fund ID, e.g. 11373-13F. Fund IDs end in F.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/funds/${params.pbId.trim()}/benchmark`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch fund benchmark')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
fundId: data.fundId ?? null,
|
||||
fundName: data.fundName ?? null,
|
||||
benchmarkFundType: data.benchmarkFundType ?? null,
|
||||
benchmarkFundSize: data.benchmarkFundSize ?? null,
|
||||
benchmarkFundLocation: data.benchmarkFundLocation ?? null,
|
||||
benchmarkFundVintageYear: data.benchmarkFundVintageYear ?? null,
|
||||
irrBenchmark: data.irrBenchmark ?? null,
|
||||
dpiBenchmark: data.dpiBenchmark ?? null,
|
||||
tvpiBenchmark: data.tvpiBenchmark ?? null,
|
||||
rvpiBenchmark: data.rvpiBenchmark ?? null,
|
||||
numberOfFundsInBenchmark: data.numberOfFundsInBenchmark ?? null,
|
||||
benchmarkFunds: data.benchmarkFunds ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID', nullable: true },
|
||||
fundName: { type: 'string', description: 'Fund name', nullable: true },
|
||||
benchmarkFundType: {
|
||||
type: 'object',
|
||||
description: 'Fund type the benchmark is built from',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
benchmarkFundSize: {
|
||||
type: 'object',
|
||||
description: 'Fund size bucket the benchmark is built from',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
benchmarkFundLocation: {
|
||||
type: 'object',
|
||||
description: 'Location the benchmark is built from',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
benchmarkFundVintageYear: {
|
||||
type: 'number',
|
||||
description: 'Vintage year the benchmark is built from',
|
||||
nullable: true,
|
||||
},
|
||||
irrBenchmark: { type: 'number', description: 'Benchmark IRR', nullable: true },
|
||||
dpiBenchmark: { type: 'number', description: 'Benchmark DPI', nullable: true },
|
||||
tvpiBenchmark: { type: 'number', description: 'Benchmark TVPI', nullable: true },
|
||||
rvpiBenchmark: { type: 'number', description: 'Benchmark RVPI', nullable: true },
|
||||
numberOfFundsInBenchmark: {
|
||||
type: 'number',
|
||||
description: 'How many funds the benchmark is drawn from',
|
||||
nullable: true,
|
||||
},
|
||||
benchmarkFunds: {
|
||||
type: 'array',
|
||||
description: 'Funds making up the benchmark',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID' },
|
||||
fundName: { type: 'string', description: 'Fund name' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookFundBioTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_fund_bio',
|
||||
name: 'PitchBook Fund Bio',
|
||||
description:
|
||||
'Retrieve the profile of a fund: managers, vintage, status, type, size, target, location, and team',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook fund ID, e.g. 11373-13F. Fund IDs end in F and come from a fund search.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/funds/${params.pbId.trim()}/bio`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch fund bio')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
fundId: data.fundId ?? null,
|
||||
name: data.name ?? null,
|
||||
fundInvestors: data.fundInvestors ?? [],
|
||||
vintage: data.vintage ?? null,
|
||||
fundStatus: data.fundStatus ?? null,
|
||||
fundType: data.fundType ?? null,
|
||||
fundSize: data.fundSize ?? null,
|
||||
location: data.location ?? null,
|
||||
fundTeam: data.fundTeam ?? [],
|
||||
openDate: data.openDate ?? null,
|
||||
closeDate: data.closeDate ?? null,
|
||||
fundTargetSize: data.fundTargetSize ?? null,
|
||||
sbic: data.sbic ?? false,
|
||||
returnsInfoAvailable: data.returnsInfoAvailable ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID', nullable: true },
|
||||
name: { type: 'string', description: 'Fund name', nullable: true },
|
||||
fundInvestors: {
|
||||
type: 'array',
|
||||
description: 'Managers of the fund, with where it sits in their fund series',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID' },
|
||||
investorName: { type: 'string', description: 'Investor name' },
|
||||
fundNo: {
|
||||
type: 'number',
|
||||
description: 'Position in the manager fund series',
|
||||
nullable: true,
|
||||
},
|
||||
firstFund: { type: 'boolean', description: 'Whether this is the manager first fund' },
|
||||
},
|
||||
},
|
||||
},
|
||||
vintage: { type: 'number', description: 'Vintage year of the fund', nullable: true },
|
||||
fundStatus: {
|
||||
type: 'string',
|
||||
description: 'Whether the fund is open or closed',
|
||||
nullable: true,
|
||||
},
|
||||
fundType: { type: 'string', description: 'Type of the fund', nullable: true },
|
||||
fundSize: {
|
||||
type: 'object',
|
||||
description: 'Capital raised by the fund',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
location: {
|
||||
type: 'object',
|
||||
description: 'Office the fund is run from',
|
||||
nullable: true,
|
||||
properties: {
|
||||
location: { type: 'string', description: 'Office label', nullable: true },
|
||||
addressLine1: { type: 'string', description: 'Address line 1', nullable: true },
|
||||
addressLine2: { type: 'string', description: 'Address line 2', nullable: true },
|
||||
city: { type: 'string', description: 'City', nullable: true },
|
||||
stateProvince: { type: 'string', description: 'State or province', nullable: true },
|
||||
postCode: { type: 'string', description: 'Postal code', nullable: true },
|
||||
country: { type: 'string', description: 'Country', nullable: true },
|
||||
phone: { type: 'string', description: 'Phone number', nullable: true },
|
||||
fax: { type: 'string', description: 'Fax number', nullable: true },
|
||||
email: { type: 'string', description: 'Email address', nullable: true },
|
||||
globalRegion: { type: 'string', description: 'Global region', nullable: true },
|
||||
globalSubRegion: { type: 'string', description: 'Global sub-region', nullable: true },
|
||||
},
|
||||
},
|
||||
fundTeam: {
|
||||
type: 'array',
|
||||
description: 'People on the fund team',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
personId: { type: 'string', description: 'PitchBook person ID' },
|
||||
personFullName: { type: 'string', description: 'Full name of the person' },
|
||||
},
|
||||
},
|
||||
},
|
||||
openDate: { type: 'string', description: 'Date the fund opened (YYYY-MM-DD)', nullable: true },
|
||||
closeDate: { type: 'string', description: 'Date the fund closed (YYYY-MM-DD)', nullable: true },
|
||||
fundTargetSize: {
|
||||
type: 'object',
|
||||
description: 'Target raise for the fund, as a min and max monetary value',
|
||||
nullable: true,
|
||||
properties: {
|
||||
min: {
|
||||
type: 'json',
|
||||
description: 'Minimum, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
max: {
|
||||
type: 'json',
|
||||
description: 'Maximum, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
sbic: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the fund is a Small Business Investment Company',
|
||||
},
|
||||
returnsInfoAvailable: {
|
||||
type: 'array',
|
||||
description: 'Which returns datasets are available for the fund',
|
||||
items: { type: 'object' },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
import type { PitchbookFundCashFlowsParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookFundCashFlowsTool: ToolConfig<
|
||||
PitchbookFundCashFlowsParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_fund_cash_flows',
|
||||
name: 'PitchBook Fund Cash Flows',
|
||||
description:
|
||||
'Retrieve contributed, distributed, and remaining value for a fund as of a specific quarter',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook fund ID, e.g. 11373-13F. Fund IDs end in F.',
|
||||
},
|
||||
period: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Reporting quarter to fetch, formatted as quarter then year, e.g. 4Q2018',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) =>
|
||||
`${PITCHBOOK_API_BASE}/funds/${params.pbId.trim()}/cashflows/${params.period.trim()}`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch fund cash flows')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
fundId: data.fundId ?? null,
|
||||
fundName: data.fundName ?? null,
|
||||
asOfQuarter: data.asOfQuarter ?? null,
|
||||
asOfYear: data.asOfYear ?? null,
|
||||
contributed: data.contributed ?? null,
|
||||
percentCalledDown: data.percentCalledDown ?? null,
|
||||
dryPowder: data.dryPowder ?? null,
|
||||
percentDryPowder: data.percentDryPowder ?? null,
|
||||
distributed: data.distributed ?? null,
|
||||
remainingValue: data.remainingValue ?? null,
|
||||
distributedRemaining: data.distributedRemaining ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID', nullable: true },
|
||||
fundName: { type: 'string', description: 'Fund name', nullable: true },
|
||||
asOfQuarter: {
|
||||
type: 'number',
|
||||
description: 'Quarter the figures are reported as of',
|
||||
nullable: true,
|
||||
},
|
||||
asOfYear: {
|
||||
type: 'number',
|
||||
description: 'Year the figures are reported as of',
|
||||
nullable: true,
|
||||
},
|
||||
contributed: {
|
||||
type: 'object',
|
||||
description: 'Capital contributed by limited partners',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
percentCalledDown: {
|
||||
type: 'number',
|
||||
description: 'Percentage of committed capital called down',
|
||||
nullable: true,
|
||||
},
|
||||
dryPowder: {
|
||||
type: 'object',
|
||||
description: 'Uncalled capital available to deploy',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
percentDryPowder: {
|
||||
type: 'number',
|
||||
description: 'Percentage of committed capital still uncalled',
|
||||
nullable: true,
|
||||
},
|
||||
distributed: {
|
||||
type: 'object',
|
||||
description: 'Capital distributed back to limited partners',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
remainingValue: {
|
||||
type: 'object',
|
||||
description: 'Remaining value held in the fund',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
distributedRemaining: {
|
||||
type: 'object',
|
||||
description: 'Distributed plus remaining value',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookFundCommitmentsTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_fund_commitments',
|
||||
name: 'PitchBook Fund Commitments',
|
||||
description:
|
||||
'Retrieve the limited partners committed to a fund, with commitment date, size, status, and type',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook fund ID, e.g. 11373-13F. Fund IDs end in F and come from a fund search.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/funds/${params.pbId.trim()}/commitments`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch fund commitments')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
commitments: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
commitments: {
|
||||
type: 'array',
|
||||
description: 'Limited partner commitments to the fund',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID' },
|
||||
limitedPartnerId: { type: 'string', description: 'PitchBook limited partner ID' },
|
||||
limitedPartnerName: { type: 'string', description: 'Limited partner name' },
|
||||
commitmentDate: {
|
||||
type: 'string',
|
||||
description: 'Date of the commitment (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
commitmentSize: {
|
||||
type: 'json',
|
||||
description: 'Size of the commitment, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
commitmentStatus: {
|
||||
type: 'json',
|
||||
description: 'Status of the commitment, as a code and description pair',
|
||||
nullable: true,
|
||||
},
|
||||
commitmentType: {
|
||||
type: 'json',
|
||||
description: 'Type of the commitment, as a code and description pair',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookFundInvestmentPreferencesTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_fund_investment_preferences',
|
||||
name: 'PitchBook Fund Investment Preferences',
|
||||
description:
|
||||
'Retrieve what a fund targets: check size, valuation, geography, industry, vertical, and deal type preferences',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook fund ID, e.g. 11373-13F. Fund IDs end in F.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/funds/${params.pbId.trim()}/investment-preferences`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch fund investment preferences')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
fundId: data.fundId ?? null,
|
||||
preferredInvestmentAmount: data.preferredInvestmentAmount ?? null,
|
||||
preferredDealSize: data.preferredDealSize ?? null,
|
||||
preferredCompanyValuation: data.preferredCompanyValuation ?? null,
|
||||
preferredEbitda: data.preferredEbitda ?? null,
|
||||
preferredEbit: data.preferredEbit ?? null,
|
||||
preferredRevenue: data.preferredRevenue ?? null,
|
||||
preferredInvestmentHorizon: data.preferredInvestmentHorizon ?? null,
|
||||
geographicalPreferences: data.geographicalPreferences ?? [],
|
||||
otherInvestmentPreferences: data.otherInvestmentPreferences ?? [],
|
||||
preferredIndustry: data.preferredIndustry ?? [],
|
||||
preferredDealTypes: data.preferredDealTypes ?? [],
|
||||
preferredVerticals: data.preferredVerticals ?? [],
|
||||
assetPreferences: data.assetPreferences ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID', nullable: true },
|
||||
preferredInvestmentAmount: {
|
||||
type: 'json',
|
||||
description: 'Preferred check size',
|
||||
nullable: true,
|
||||
},
|
||||
preferredDealSize: { type: 'json', description: 'Preferred deal size', nullable: true },
|
||||
preferredCompanyValuation: {
|
||||
type: 'json',
|
||||
description: 'Preferred company valuation',
|
||||
nullable: true,
|
||||
},
|
||||
preferredEbitda: { type: 'json', description: 'Preferred EBITDA', nullable: true },
|
||||
preferredEbit: { type: 'json', description: 'Preferred EBIT', nullable: true },
|
||||
preferredRevenue: { type: 'json', description: 'Preferred revenue', nullable: true },
|
||||
preferredInvestmentHorizon: {
|
||||
type: 'json',
|
||||
description: 'Preferred holding period in years',
|
||||
nullable: true,
|
||||
},
|
||||
geographicalPreferences: {
|
||||
type: 'array',
|
||||
description: 'Regions targeted',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
regionGroup: {
|
||||
type: 'object',
|
||||
description: 'Broad region as a code and description pair',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
regionSegment: {
|
||||
type: 'object',
|
||||
description: 'Region segment as a code and description pair',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
regionCode: {
|
||||
type: 'object',
|
||||
description: 'Country as a code and description pair',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
regionState: {
|
||||
type: 'json',
|
||||
description: 'State or province as a code and description pair',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
otherInvestmentPreferences: {
|
||||
type: 'array',
|
||||
description: 'Other stated preferences',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
preferredIndustry: {
|
||||
type: 'array',
|
||||
description: 'Industries targeted',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
industryCode: {
|
||||
type: 'json',
|
||||
description: 'Most specific industry classification',
|
||||
nullable: true,
|
||||
},
|
||||
industrySector: {
|
||||
type: 'object',
|
||||
description: 'Top-level sector',
|
||||
properties: {
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
industryGroup: {
|
||||
type: 'object',
|
||||
description: 'Industry group within the sector',
|
||||
properties: {
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary entry' },
|
||||
},
|
||||
},
|
||||
},
|
||||
preferredDealTypes: {
|
||||
type: 'array',
|
||||
description: 'Deal types targeted',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
preferredVerticals: {
|
||||
type: 'array',
|
||||
description: 'Verticals targeted',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
assetPreferences: {
|
||||
type: 'array',
|
||||
description: 'Asset classes and subcategories targeted',
|
||||
items: { type: 'json' },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookFundInvestmentsTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_fund_investments',
|
||||
name: 'PitchBook Fund Investments',
|
||||
description:
|
||||
'Retrieve every investment a fund has made, active and exited, with the deals that opened and closed each position',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook fund ID, e.g. 11373-13F. Fund IDs end in F.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/funds/${params.pbId.trim()}/investments`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch fund investments')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
fundId: data.fundId ?? null,
|
||||
fundName: data.fundName ?? null,
|
||||
investments: data.investments ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID', nullable: true },
|
||||
fundName: { type: 'string', description: 'Fund name', nullable: true },
|
||||
investments: {
|
||||
type: 'array',
|
||||
description: 'Investments held',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
targetCompanyId: { type: 'string', description: 'PitchBook ID of the portfolio company' },
|
||||
targetCompanyName: { type: 'string', description: 'Name of the portfolio company' },
|
||||
investmentStatus: {
|
||||
type: 'string',
|
||||
description: 'Whether the position is active or exited',
|
||||
},
|
||||
targetCompanyInvestmentDate: {
|
||||
type: 'string',
|
||||
description: 'Date the position was opened (YYYY-MM-DD)',
|
||||
},
|
||||
investmentDealId: { type: 'string', description: 'PitchBook deal ID of the investment' },
|
||||
targetCompanyExitDate: {
|
||||
type: 'string',
|
||||
description: 'Date the position was exited (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
exitDealId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook deal ID of the exit',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookFundPerformanceTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_fund_performance',
|
||||
name: 'PitchBook Fund Performance',
|
||||
description:
|
||||
'Retrieve the most recent reported returns for a fund: IRR, DPI, RVPI, TVPI, NAV, and benchmark quartile',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook fund ID, e.g. 11373-13F. Fund IDs end in F and come from a fund search.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/funds/${params.pbId.trim()}/performance`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch fund performance')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
fundId: data.fundId ?? null,
|
||||
fundName: data.fundName ?? null,
|
||||
asOfQuarter: data.asOfQuarter ?? null,
|
||||
asOfYear: data.asOfYear ?? null,
|
||||
irr: data.irr ?? null,
|
||||
dpi: data.dpi ?? null,
|
||||
rvpi: data.rvpi ?? null,
|
||||
tvpi: data.tvpi ?? null,
|
||||
nav: data.nav ?? null,
|
||||
quartile: data.quartile ?? null,
|
||||
numberOfFundsInBenchmark: data.numberOfFundsInBenchmark ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID', nullable: true },
|
||||
fundName: { type: 'string', description: 'Fund name', nullable: true },
|
||||
asOfQuarter: {
|
||||
type: 'number',
|
||||
description: 'Quarter the figures are reported as of',
|
||||
nullable: true,
|
||||
},
|
||||
asOfYear: {
|
||||
type: 'number',
|
||||
description: 'Year the figures are reported as of',
|
||||
nullable: true,
|
||||
},
|
||||
irr: {
|
||||
type: 'number',
|
||||
description: 'Internal rate of return, as a percentage',
|
||||
nullable: true,
|
||||
},
|
||||
dpi: { type: 'number', description: 'Distributions to paid-in multiple', nullable: true },
|
||||
rvpi: { type: 'number', description: 'Residual value to paid-in multiple', nullable: true },
|
||||
tvpi: { type: 'number', description: 'Total value to paid-in multiple', nullable: true },
|
||||
nav: { type: 'number', description: 'Net asset value', nullable: true },
|
||||
quartile: {
|
||||
type: 'number',
|
||||
description: 'Benchmark quartile the fund falls in, 1 being the best',
|
||||
nullable: true,
|
||||
},
|
||||
numberOfFundsInBenchmark: {
|
||||
type: 'number',
|
||||
description: 'How many funds the benchmark is drawn from',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
import type { PitchbookFundSearchParams, PitchbookSearchResponse } from '@/tools/pitchbook/types'
|
||||
import {
|
||||
buildSearchQuery,
|
||||
mapStats,
|
||||
PITCHBOOK_API_BASE,
|
||||
pitchbookAuthHeaders,
|
||||
throwIfNotOk,
|
||||
} from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookFundSearchTool: ToolConfig<
|
||||
PitchbookFundSearchParams,
|
||||
PitchbookSearchResponse
|
||||
> = {
|
||||
id: 'pitchbook_fund_search',
|
||||
name: 'PitchBook Fund Search',
|
||||
description: 'Search PitchBook for funds by manager, type, size, vintage, and performance',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
fundNames: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated fund names or PitchBook fund IDs',
|
||||
},
|
||||
investorNames: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated names or PitchBook IDs of the fund managers',
|
||||
},
|
||||
fundType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook fund type code',
|
||||
},
|
||||
fundSize: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Fund size in millions. Use >500, <500, or 1^5000 for a range',
|
||||
},
|
||||
dryPowder: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Dry powder in millions. Use >500, <500, or 1^500 for a range',
|
||||
},
|
||||
vintage: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Vintage year. Use >2015, <2015, or 2015^2020 for a range',
|
||||
},
|
||||
city: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'City the fund is located in',
|
||||
},
|
||||
country: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Country the fund is located in (e.g. USA)',
|
||||
},
|
||||
irr: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Internal rate of return as a percentage. Use >20, <20, or 10^20 for a range',
|
||||
},
|
||||
tvpi: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Total value to paid-in multiple. Use >2, <2, or 1^2 for a range',
|
||||
},
|
||||
dpi: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Distributions to paid-in multiple. Use >1, <1, or 1^2 for a range',
|
||||
},
|
||||
industryPreferences: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Preferred industry codes the fund targets',
|
||||
},
|
||||
geographicalPreferences: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Preferred geography codes the fund targets',
|
||||
},
|
||||
filterCurrency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code the monetary filters on this search are expressed in, e.g. setting EUR means dealSize is read as millions of euros. Distinct from `currency`, which converts the values PitchBook returns.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
page: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Page of results to return, starting at 1',
|
||||
},
|
||||
perPage: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'How many results to return per page',
|
||||
},
|
||||
additionalFilters: {
|
||||
type: 'json',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Any other documented search filter, as a JSON object of query parameter names to values (e.g. {"emergingSpaces": "AGTECH"}). A dedicated field always wins over the same key set here.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const query = buildSearchQuery(
|
||||
{
|
||||
fundNames: params.fundNames,
|
||||
investorNames: params.investorNames,
|
||||
fundType: params.fundType,
|
||||
fundSize: params.fundSize,
|
||||
dryPowder: params.dryPowder,
|
||||
vintage: params.vintage,
|
||||
city: params.city,
|
||||
country: params.country,
|
||||
irr: params.irr,
|
||||
tvpi: params.tvpi,
|
||||
dpi: params.dpi,
|
||||
industryPreferences: params.industryPreferences,
|
||||
geographicalPreferences: params.geographicalPreferences,
|
||||
currency: params.filterCurrency,
|
||||
},
|
||||
{
|
||||
page: params.page,
|
||||
perPage: params.perPage,
|
||||
additionalFilters: params.additionalFilters,
|
||||
}
|
||||
)
|
||||
return `${PITCHBOOK_API_BASE}/funds/search${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to search funds')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stats: mapStats(data.stats),
|
||||
items: data.items ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stats: {
|
||||
type: 'object',
|
||||
description: 'Paging envelope for the result set',
|
||||
properties: {
|
||||
total: { type: 'number', description: 'Total number of matching results' },
|
||||
perPage: { type: 'number', description: 'Results returned per page' },
|
||||
page: { type: 'number', description: 'Current page number' },
|
||||
lastPage: { type: 'number', description: 'Number of the last available page' },
|
||||
},
|
||||
},
|
||||
items: {
|
||||
type: 'array',
|
||||
description: 'Funds matching the search criteria',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID' },
|
||||
fundName: { type: 'string', description: 'Fund name' },
|
||||
investors: {
|
||||
type: 'array',
|
||||
description: 'Managers of the fund',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID' },
|
||||
investorName: { type: 'string', description: 'Investor name' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookFundTeamTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_fund_team',
|
||||
name: 'PitchBook Fund Team',
|
||||
description: 'Retrieve the active and former people on a fund team',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook fund ID, e.g. 11373-13F. Fund IDs end in F.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/funds/${params.pbId.trim()}/team`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch fund team')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
fundId: data.fundId ?? null,
|
||||
investorIds: data.investorIds ?? [],
|
||||
countActiveTeam: data.countActiveTeam ?? null,
|
||||
active: data.active ?? [],
|
||||
former: data.former ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID', nullable: true },
|
||||
investorIds: {
|
||||
type: 'array',
|
||||
description: 'PitchBook IDs of the fund managers',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
countActiveTeam: {
|
||||
type: 'number',
|
||||
description: 'Number of active team members',
|
||||
nullable: true,
|
||||
},
|
||||
active: {
|
||||
type: 'array',
|
||||
description: 'Active team members',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: { type: 'string', description: 'PitchBook person ID' },
|
||||
name: { type: 'string', description: 'Name' },
|
||||
title: { type: 'string', description: 'Title' },
|
||||
infoAvailable: {
|
||||
type: 'boolean',
|
||||
description: 'Whether a full PitchBook profile is available',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
former: {
|
||||
type: 'array',
|
||||
description: 'Former team members',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: { type: 'string', description: 'PitchBook person ID' },
|
||||
name: { type: 'string', description: 'Name' },
|
||||
title: { type: 'string', description: 'Title' },
|
||||
infoAvailable: {
|
||||
type: 'boolean',
|
||||
description: 'Whether a full PitchBook profile is available',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
import type { PitchbookResponse, PitchbookUpdatesParams } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookFundUpdatesTool: ToolConfig<PitchbookUpdatesParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_fund_updates',
|
||||
name: 'PitchBook Fund Updates',
|
||||
description: 'Check which fund datasets changed in a window, so a sync only refetches what moved',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook fund ID, e.g. 11373-13F. Fund IDs end in F.',
|
||||
},
|
||||
sinceDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Window to report changes over, carrying its operator in the value: >YYYY-MM-DD for after a date, <YYYY-MM-DD for before one, or YYYY-MM-DD^YYYY-MM-DD for a range. Use this or trailingRange.',
|
||||
},
|
||||
trailingRange: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Report changes over the last N days. Use this or sinceDate.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.sinceDate) qs.set('sinceDate', params.sinceDate)
|
||||
if (params.trailingRange !== undefined && params.trailingRange !== null) {
|
||||
qs.set('trailingRange', String(params.trailingRange))
|
||||
}
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/funds/${params.pbId.trim()}/updates${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch updates')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
updates: data.updates ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
updates: {
|
||||
type: 'json',
|
||||
description:
|
||||
'Map of dataset name to whether it changed in the window. Keys are PitchBook dataset names, so read it as a plain object.',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
export { pitchbookCompanyActiveInvestorsTool } from '@/tools/pitchbook/company_active_investors'
|
||||
export { pitchbookCompanyBioTool } from '@/tools/pitchbook/company_bio'
|
||||
export { pitchbookCompanyDealServiceProvidersTool } from '@/tools/pitchbook/company_deal_service_providers'
|
||||
export { pitchbookCompanyDealsTool } from '@/tools/pitchbook/company_deals'
|
||||
export { pitchbookCompanyFinancialsTool } from '@/tools/pitchbook/company_financials'
|
||||
export { pitchbookCompanyGeneralServiceProvidersTool } from '@/tools/pitchbook/company_general_service_providers'
|
||||
export { pitchbookCompanyIndustriesTool } from '@/tools/pitchbook/company_industries'
|
||||
export { pitchbookCompanyInvestorsTool } from '@/tools/pitchbook/company_investors'
|
||||
export { pitchbookCompanyMostRecentDebtFinancingTool } from '@/tools/pitchbook/company_most_recent_debt_financing'
|
||||
export { pitchbookCompanyMostRecentFinancialsTool } from '@/tools/pitchbook/company_most_recent_financials'
|
||||
export { pitchbookCompanyMostRecentFinancingTool } from '@/tools/pitchbook/company_most_recent_financing'
|
||||
export { pitchbookCompanySearchTool } from '@/tools/pitchbook/company_search'
|
||||
export { pitchbookCompanySimilarCompaniesTool } from '@/tools/pitchbook/company_similar_companies'
|
||||
export { pitchbookCompanySocialAnalyticsTool } from '@/tools/pitchbook/company_social_analytics'
|
||||
export { pitchbookCompanyUpdatesTool } from '@/tools/pitchbook/company_updates'
|
||||
export { pitchbookCompanyVcExitPredictionsTool } from '@/tools/pitchbook/company_vc_exit_predictions'
|
||||
export { pitchbookContractsHistoryTool } from '@/tools/pitchbook/contracts_history'
|
||||
export { pitchbookCostOfCallsTool } from '@/tools/pitchbook/cost_of_calls'
|
||||
export { pitchbookCreditHistoryTool } from '@/tools/pitchbook/credit_history'
|
||||
export { pitchbookCreditNewsTool } from '@/tools/pitchbook/credit_news'
|
||||
export { pitchbookCreditNewsBulkTool } from '@/tools/pitchbook/credit_news_bulk'
|
||||
export { pitchbookCreditNewsMostRecentTool } from '@/tools/pitchbook/credit_news_most_recent'
|
||||
export { pitchbookCreditNewsSearchTool } from '@/tools/pitchbook/credit_news_search'
|
||||
export { pitchbookDealBioTool } from '@/tools/pitchbook/deal_bio'
|
||||
export { pitchbookDealCapTableHistoryTool } from '@/tools/pitchbook/deal_cap_table_history'
|
||||
export { pitchbookDealDebtLendersTool } from '@/tools/pitchbook/deal_debt_lenders'
|
||||
export { pitchbookDealDetailedTool } from '@/tools/pitchbook/deal_detailed'
|
||||
export { pitchbookDealInvestorsTool } from '@/tools/pitchbook/deal_investors'
|
||||
export { pitchbookDealMultiplesTool } from '@/tools/pitchbook/deal_multiples'
|
||||
export { pitchbookDealSearchTool } from '@/tools/pitchbook/deal_search'
|
||||
export { pitchbookDealServiceProvidersTool } from '@/tools/pitchbook/deal_service_providers'
|
||||
export { pitchbookDealStockInfoTool } from '@/tools/pitchbook/deal_stock_info'
|
||||
export { pitchbookDealTrancheInfoTool } from '@/tools/pitchbook/deal_tranche_info'
|
||||
export { pitchbookDealUpdatesTool } from '@/tools/pitchbook/deal_updates'
|
||||
export { pitchbookDealValuationTool } from '@/tools/pitchbook/deal_valuation'
|
||||
export { pitchbookEntityAffiliatesTool } from '@/tools/pitchbook/entity_affiliates'
|
||||
export { pitchbookEntityLocationsTool } from '@/tools/pitchbook/entity_locations'
|
||||
export { pitchbookEntityNewsTool } from '@/tools/pitchbook/entity_news'
|
||||
export { pitchbookEntityPeopleTool } from '@/tools/pitchbook/entity_people'
|
||||
export { pitchbookEntityUpdatesTool } from '@/tools/pitchbook/entity_updates'
|
||||
export { pitchbookFundActiveInvestmentsTool } from '@/tools/pitchbook/fund_active_investments'
|
||||
export { pitchbookFundBenchmarkTool } from '@/tools/pitchbook/fund_benchmark'
|
||||
export { pitchbookFundBioTool } from '@/tools/pitchbook/fund_bio'
|
||||
export { pitchbookFundCashFlowsTool } from '@/tools/pitchbook/fund_cash_flows'
|
||||
export { pitchbookFundCommitmentsTool } from '@/tools/pitchbook/fund_commitments'
|
||||
export { pitchbookFundInvestmentPreferencesTool } from '@/tools/pitchbook/fund_investment_preferences'
|
||||
export { pitchbookFundInvestmentsTool } from '@/tools/pitchbook/fund_investments'
|
||||
export { pitchbookFundPerformanceTool } from '@/tools/pitchbook/fund_performance'
|
||||
export { pitchbookFundSearchTool } from '@/tools/pitchbook/fund_search'
|
||||
export { pitchbookFundTeamTool } from '@/tools/pitchbook/fund_team'
|
||||
export { pitchbookFundUpdatesTool } from '@/tools/pitchbook/fund_updates'
|
||||
export { pitchbookInvestorActiveInvestmentsTool } from '@/tools/pitchbook/investor_active_investments'
|
||||
export { pitchbookInvestorBioTool } from '@/tools/pitchbook/investor_bio'
|
||||
export { pitchbookInvestorBoardSeatsTool } from '@/tools/pitchbook/investor_board_seats'
|
||||
export { pitchbookInvestorDealServiceProvidersTool } from '@/tools/pitchbook/investor_deal_service_providers'
|
||||
export { pitchbookInvestorFundsTool } from '@/tools/pitchbook/investor_funds'
|
||||
export { pitchbookInvestorGeneralServiceProvidersTool } from '@/tools/pitchbook/investor_general_service_providers'
|
||||
export { pitchbookInvestorInvestmentsTool } from '@/tools/pitchbook/investor_investments'
|
||||
export { pitchbookInvestorLastClosedFundTool } from '@/tools/pitchbook/investor_last_closed_fund'
|
||||
export { pitchbookInvestorPreferencesTool } from '@/tools/pitchbook/investor_preferences'
|
||||
export { pitchbookInvestorSearchTool } from '@/tools/pitchbook/investor_search'
|
||||
export { pitchbookInvestorUpdatesTool } from '@/tools/pitchbook/investor_updates'
|
||||
export { pitchbookLimitedPartnerActualAllocationsTool } from '@/tools/pitchbook/limited_partner_actual_allocations'
|
||||
export { pitchbookLimitedPartnerBioTool } from '@/tools/pitchbook/limited_partner_bio'
|
||||
export { pitchbookLimitedPartnerCommitmentAggregatesTool } from '@/tools/pitchbook/limited_partner_commitment_aggregates'
|
||||
export { pitchbookLimitedPartnerCommitmentPreferencesTool } from '@/tools/pitchbook/limited_partner_commitment_preferences'
|
||||
export { pitchbookLimitedPartnerCommitmentsDetailedTool } from '@/tools/pitchbook/limited_partner_commitments_detailed'
|
||||
export { pitchbookLimitedPartnerSearchTool } from '@/tools/pitchbook/limited_partner_search'
|
||||
export { pitchbookLimitedPartnerServiceProvidersTool } from '@/tools/pitchbook/limited_partner_service_providers'
|
||||
export { pitchbookLimitedPartnerTargetAllocationsTool } from '@/tools/pitchbook/limited_partner_target_allocations'
|
||||
export { pitchbookLimitedPartnerUpdatesTool } from '@/tools/pitchbook/limited_partner_updates'
|
||||
export { pitchbookLookupTableStructureTool } from '@/tools/pitchbook/lookup_table_structure'
|
||||
export { pitchbookLookupTablesTool } from '@/tools/pitchbook/lookup_tables'
|
||||
export { pitchbookPatentDetailedTool } from '@/tools/pitchbook/patent_detailed'
|
||||
export { pitchbookPatentSearchTool } from '@/tools/pitchbook/patent_search'
|
||||
export { pitchbookPeopleSearchTool } from '@/tools/pitchbook/people_search'
|
||||
export { pitchbookPersonBioTool } from '@/tools/pitchbook/person_bio'
|
||||
export { pitchbookPersonContactTool } from '@/tools/pitchbook/person_contact'
|
||||
export { pitchbookPersonEducationWorkTool } from '@/tools/pitchbook/person_education_work'
|
||||
export { pitchbookSandboxEntitiesTool } from '@/tools/pitchbook/sandbox_entities'
|
||||
export { pitchbookSearchTool } from '@/tools/pitchbook/search'
|
||||
export { pitchbookServiceProviderBioTool } from '@/tools/pitchbook/service_provider_bio'
|
||||
export { pitchbookServiceProviderSearchTool } from '@/tools/pitchbook/service_provider_search'
|
||||
export { pitchbookServiceProviderUpdatesTool } from '@/tools/pitchbook/service_provider_updates'
|
||||
export { pitchbookServicedCompaniesTool } from '@/tools/pitchbook/serviced_companies'
|
||||
export { pitchbookServicedDealsTool } from '@/tools/pitchbook/serviced_deals'
|
||||
export { pitchbookServicedFundsTool } from '@/tools/pitchbook/serviced_funds'
|
||||
export { pitchbookServicedInvestorsTool } from '@/tools/pitchbook/serviced_investors'
|
||||
export { pitchbookServicedLimitedPartnersTool } from '@/tools/pitchbook/serviced_limited_partners'
|
||||
export { pitchbookSharedSearchTool } from '@/tools/pitchbook/shared_search'
|
||||
export type * from '@/tools/pitchbook/types'
|
||||
export { pitchbookUsageReportTool } from '@/tools/pitchbook/usage_report'
|
||||
@@ -0,0 +1,77 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookInvestorActiveInvestmentsTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_investor_active_investments',
|
||||
name: 'PitchBook Investor Active Investments',
|
||||
description: 'Retrieve only the positions an investor still holds',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook investor ID, e.g. 58781-35.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/investors/${params.pbId.trim()}/active-investments`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch investor active investments')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
activeInvestments: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
activeInvestments: {
|
||||
type: 'array',
|
||||
description: 'Positions the investor still holds',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID' },
|
||||
companyId: { type: 'string', description: 'PitchBook company ID' },
|
||||
companyName: { type: 'string', description: 'Company name' },
|
||||
investorSince: {
|
||||
type: 'string',
|
||||
description: 'Date the investor first invested (YYYY-MM-DD)',
|
||||
},
|
||||
investmentDealId: { type: 'string', description: 'PitchBook deal ID of the investment' },
|
||||
investmentDate: {
|
||||
type: 'string',
|
||||
description: 'Date the position was opened (YYYY-MM-DD)',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookInvestorBioTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_investor_bio',
|
||||
name: 'PitchBook Investor Bio',
|
||||
description:
|
||||
'Retrieve the core profile of an investor: names, description, HQ, type, AUM, dry powder, and headcount',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook investor ID, e.g. 58781-35. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/investors/${params.pbId.trim()}/bio`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch investor bio')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
investorId: data.investorId ?? null,
|
||||
investorName: data.investorName ?? null,
|
||||
hqLocation: data.hqLocation ?? null,
|
||||
description: data.description ?? null,
|
||||
investorStatus: data.investorStatus ?? null,
|
||||
assetsUnderManagement: data.assetsUnderManagement ?? null,
|
||||
dryPowder: data.dryPowder ?? null,
|
||||
yearFounded: data.yearFounded ?? null,
|
||||
website: data.website ?? null,
|
||||
countInvestmentProfessionals: data.countInvestmentProfessionals ?? null,
|
||||
investorType: data.investorType ?? [],
|
||||
tradeAssociations: data.tradeAssociations ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID', nullable: true },
|
||||
investorName: {
|
||||
type: 'object',
|
||||
description: 'The names the investor is known by',
|
||||
properties: {
|
||||
formalName: { type: 'string', description: 'Formal name', nullable: true },
|
||||
alsoKnownAs: { type: 'string', description: 'Also-known-as name', nullable: true },
|
||||
legalName: { type: 'string', description: 'Registered legal name', nullable: true },
|
||||
formerlyKnownAs: { type: 'string', description: 'Previous name', nullable: true },
|
||||
},
|
||||
},
|
||||
hqLocation: {
|
||||
type: 'object',
|
||||
description: 'Headquarters location',
|
||||
nullable: true,
|
||||
properties: {
|
||||
city: { type: 'string', description: 'City', nullable: true },
|
||||
stateProvince: { type: 'string', description: 'State or province', nullable: true },
|
||||
postCode: { type: 'string', description: 'Postal code', nullable: true },
|
||||
country: { type: 'string', description: 'Country', nullable: true },
|
||||
},
|
||||
},
|
||||
description: {
|
||||
type: 'object',
|
||||
description: 'Investor description in brief and full form',
|
||||
nullable: true,
|
||||
properties: {
|
||||
brief: { type: 'string', description: 'Short description', nullable: true },
|
||||
full: { type: 'string', description: 'Full description', nullable: true },
|
||||
},
|
||||
},
|
||||
investorStatus: {
|
||||
type: 'object',
|
||||
description: 'Whether the investor is actively investing',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code', nullable: true },
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
investorType: {
|
||||
type: 'array',
|
||||
description: 'Types the investor is classified as, one flagged primary',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
type: {
|
||||
type: 'object',
|
||||
description: 'Investor type',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Investor type code' },
|
||||
description: { type: 'string', description: 'Investor type label' },
|
||||
},
|
||||
},
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary type' },
|
||||
},
|
||||
},
|
||||
},
|
||||
assetsUnderManagement: {
|
||||
type: 'object',
|
||||
description: 'Assets under management',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
dryPowder: {
|
||||
type: 'object',
|
||||
description: 'Uncalled capital available to deploy',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
yearFounded: { type: 'number', description: 'Year the investor was founded', nullable: true },
|
||||
website: { type: 'string', description: 'Investor website', nullable: true },
|
||||
countInvestmentProfessionals: {
|
||||
type: 'number',
|
||||
description: 'Number of investment professionals on staff',
|
||||
nullable: true,
|
||||
},
|
||||
tradeAssociations: {
|
||||
type: 'array',
|
||||
description: 'Trade associations the investor belongs to',
|
||||
items: { type: 'object' },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookInvestorBoardSeatsTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_investor_board_seats',
|
||||
name: 'PitchBook Investor Board Seats',
|
||||
description:
|
||||
'Retrieve the board seats an investor holds and previously held across its portfolio',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook investor ID, e.g. 58781-35.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/investors/${params.pbId.trim()}/board-seats`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch investor board seats')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
investorId: data.investorId ?? null,
|
||||
current: data.current ?? [],
|
||||
former: data.former ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID', nullable: true },
|
||||
current: {
|
||||
type: 'array',
|
||||
description: 'Current entries',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
personId: { type: 'string', description: 'PitchBook person ID' },
|
||||
personName: { type: 'string', description: 'Full name of the person' },
|
||||
boardCompanyId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the company the seat is on',
|
||||
},
|
||||
boardCompanyName: { type: 'string', description: 'Name of the company the seat is on' },
|
||||
onBoard: { type: 'boolean', description: 'Whether the person holds a board seat' },
|
||||
boardStartDate: { type: 'string', description: 'Date the seat started (YYYY-MM-DD)' },
|
||||
boardEndDate: {
|
||||
type: 'json',
|
||||
description: 'Date the seat ended (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
role: { type: 'string', description: 'Role played' },
|
||||
},
|
||||
},
|
||||
},
|
||||
former: {
|
||||
type: 'array',
|
||||
description: 'Former team members',
|
||||
items: { type: 'json' },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookInvestorDealServiceProvidersTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_investor_deal_service_providers',
|
||||
name: 'PitchBook Investor Deal Service Providers',
|
||||
description:
|
||||
'Retrieve the service providers that worked on an investor deals, and what each was hired for',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook investor ID, e.g. 58781-35.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/investors/${params.pbId.trim()}/deal-service-providers`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch investor deal service providers')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
dealServiceProviders: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
dealServiceProviders: {
|
||||
type: 'array',
|
||||
description: 'Service providers engaged on the investor deals',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID' },
|
||||
serviceProviderId: { type: 'string', description: 'PitchBook service provider ID' },
|
||||
serviceProviderName: { type: 'string', description: 'Service provider name' },
|
||||
serviceProviderTypes: {
|
||||
type: 'array',
|
||||
description: 'Types the service provider is classified as',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary entry' },
|
||||
type: {
|
||||
type: 'object',
|
||||
description: 'Type as a code and description pair',
|
||||
properties: {
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
},
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
serviceProvided: {
|
||||
type: 'object',
|
||||
description: 'Service provided, as a code and description pair',
|
||||
properties: {
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
dealIdServiceProvided: {
|
||||
type: 'string',
|
||||
description: 'PitchBook deal ID the service was provided on',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookInvestorFundsTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_investor_funds',
|
||||
name: 'PitchBook Investor Funds',
|
||||
description:
|
||||
'Retrieve the funds an investor manages, with open and closed counts and the min, median, and max fund size',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook investor ID, e.g. 58781-35. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/investors/${params.pbId.trim()}/funds`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch investor funds')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
investorId: data.investorId ?? null,
|
||||
stats: data.stats ?? null,
|
||||
minFundSize: data.minFundSize ?? null,
|
||||
medianFundSize: data.medianFundSize ?? null,
|
||||
maxFundSize: data.maxFundSize ?? null,
|
||||
fundInfo: data.fundInfo ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID', nullable: true },
|
||||
stats: {
|
||||
type: 'object',
|
||||
description: 'Counts of open and closed funds',
|
||||
nullable: true,
|
||||
properties: {
|
||||
totalFundsOpen: { type: 'number', description: 'Number of open funds' },
|
||||
totalFundsClosed: { type: 'number', description: 'Number of closed funds' },
|
||||
},
|
||||
},
|
||||
minFundSize: {
|
||||
type: 'object',
|
||||
description: 'Smallest fund raised',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
medianFundSize: {
|
||||
type: 'object',
|
||||
description: 'Median fund size',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
maxFundSize: {
|
||||
type: 'object',
|
||||
description: 'Largest fund raised',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency', nullable: true },
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount', nullable: true },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
fundInfo: {
|
||||
type: 'array',
|
||||
description: 'Funds the investor manages',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID' },
|
||||
fundName: { type: 'string', description: 'Fund name' },
|
||||
fundType: {
|
||||
type: 'object',
|
||||
description: 'Type of the fund',
|
||||
nullable: true,
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Fund type code', nullable: true },
|
||||
description: { type: 'string', description: 'Fund type label', nullable: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookInvestorGeneralServiceProvidersTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_investor_general_service_providers',
|
||||
name: 'PitchBook Investor General Service Providers',
|
||||
description: 'Retrieve the current and former general service providers engaged by an investor',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook investor ID, e.g. 58781-35.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) =>
|
||||
`${PITCHBOOK_API_BASE}/investors/${params.pbId.trim()}/general-service-providers`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch investor general service providers')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
investorId: data.investorId ?? null,
|
||||
currentGeneralServices: data.currentGeneralServices ?? [],
|
||||
formerGeneralServices: data.formerGeneralServices ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID', nullable: true },
|
||||
currentGeneralServices: {
|
||||
type: 'array',
|
||||
description: 'Current general service relationships',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
serviceProviderId: { type: 'string', description: 'PitchBook service provider ID' },
|
||||
serviceProviderName: { type: 'string', description: 'Service provider name' },
|
||||
serviceProviderTypes: {
|
||||
type: 'array',
|
||||
description: 'Types the service provider is classified as',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary entry' },
|
||||
type: {
|
||||
type: 'object',
|
||||
description: 'Type as a code and description pair',
|
||||
properties: {
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
},
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
serviceProvided: {
|
||||
type: 'object',
|
||||
description: 'Service provided, as a code and description pair',
|
||||
properties: {
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
formerGeneralServices: {
|
||||
type: 'array',
|
||||
description: 'Former general service relationships',
|
||||
items: { type: 'json' },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookInvestorInvestmentsTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_investor_investments',
|
||||
name: 'PitchBook Investor Investments',
|
||||
description:
|
||||
'Retrieve every investment an investor has made, active and exited, with the deals that opened and closed each position',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook investor ID, e.g. 58781-35. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/investors/${params.pbId.trim()}/investments`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch investor investments')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
investments: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
investments: {
|
||||
type: 'array',
|
||||
description: 'Investments the investor has made, active and exited',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID' },
|
||||
companyId: { type: 'string', description: 'PitchBook ID of the portfolio company' },
|
||||
companyName: { type: 'string', description: 'Name of the portfolio company' },
|
||||
investorStatus: {
|
||||
type: 'string',
|
||||
description: 'Whether the investor is a current or former holder',
|
||||
nullable: true,
|
||||
},
|
||||
investmentDate: {
|
||||
type: 'string',
|
||||
description: 'Date the position was opened (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
investmentDealId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook deal ID of the investment',
|
||||
nullable: true,
|
||||
},
|
||||
exitDate: {
|
||||
type: 'string',
|
||||
description: 'Date the position was exited (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
exitDealId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook deal ID of the exit',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookInvestorLastClosedFundTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_investor_last_closed_fund',
|
||||
name: 'PitchBook Investor Last Closed Fund',
|
||||
description:
|
||||
'Retrieve the most recently closed fund raised by an investor, with its size, type, and vintage',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook investor ID, e.g. 58781-35.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/investors/${params.pbId.trim()}/last-closed-fund`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch investor last closed fund')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
investorId: data.investorId ?? null,
|
||||
fundId: data.fundId ?? null,
|
||||
fundName: data.fundName ?? null,
|
||||
fundVintage: data.fundVintage ?? null,
|
||||
fundSize: data.fundSize ?? null,
|
||||
fundType: data.fundType ?? null,
|
||||
fundCloseDate: data.fundCloseDate ?? null,
|
||||
fundOpenDate: data.fundOpenDate ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID', nullable: true },
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID', nullable: true },
|
||||
fundName: { type: 'string', description: 'Fund name', nullable: true },
|
||||
fundVintage: { type: 'number', description: 'Vintage year of the fund', nullable: true },
|
||||
fundSize: {
|
||||
type: 'object',
|
||||
description: 'Capital raised by the fund',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
fundType: {
|
||||
type: 'object',
|
||||
description: 'Fund type',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
fundCloseDate: {
|
||||
type: 'string',
|
||||
description: 'Date the fund closed (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
fundOpenDate: {
|
||||
type: 'json',
|
||||
description: 'Date the fund opened (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,259 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookInvestorPreferencesTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_investor_preferences',
|
||||
name: 'PitchBook Investor Preferences',
|
||||
description:
|
||||
'Retrieve what an investor targets: check size, deal size, valuation, revenue, geography, industry, and deal type preferences',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook investor ID, e.g. 58781-35. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/investors/${params.pbId.trim()}/investment-preferences`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch investor preferences')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
investorId: data.investorId ?? null,
|
||||
investorName: data.investorName ?? null,
|
||||
preferredInvestmentAmount: data.preferredInvestmentAmount ?? null,
|
||||
preferredDealSize: data.preferredDealSize ?? null,
|
||||
preferredCompanyValuation: data.preferredCompanyValuation ?? null,
|
||||
preferredEbitda: data.preferredEbitda ?? null,
|
||||
preferredEbit: data.preferredEbit ?? null,
|
||||
preferredRevenue: data.preferredRevenue ?? null,
|
||||
preferredInvestmentHorizon: data.preferredInvestmentHorizon ?? null,
|
||||
geographicalPreferences: data.geographicalPreferences ?? [],
|
||||
otherInvestmentPreferences: data.otherInvestmentPreferences ?? [],
|
||||
preferredIndustry: data.preferredIndustry ?? [],
|
||||
preferredDealTypes: data.preferredDealTypes ?? [],
|
||||
preferredVerticals: data.preferredVerticals ?? [],
|
||||
assetPreferences: data.assetPreferences ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID', nullable: true },
|
||||
investorName: { type: 'string', description: 'Investor name', nullable: true },
|
||||
preferredInvestmentAmount: {
|
||||
type: 'object',
|
||||
description: 'Preferred check size, as a min and max monetary value',
|
||||
nullable: true,
|
||||
properties: {
|
||||
min: {
|
||||
type: 'json',
|
||||
description: 'Minimum, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
max: {
|
||||
type: 'json',
|
||||
description: 'Maximum, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
preferredDealSize: {
|
||||
type: 'object',
|
||||
description: 'Preferred total deal size, as a min and max monetary value',
|
||||
nullable: true,
|
||||
properties: {
|
||||
min: {
|
||||
type: 'json',
|
||||
description: 'Minimum, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
max: {
|
||||
type: 'json',
|
||||
description: 'Maximum, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
preferredCompanyValuation: {
|
||||
type: 'object',
|
||||
description: 'Preferred company valuation, as a min and max monetary value',
|
||||
nullable: true,
|
||||
properties: {
|
||||
min: {
|
||||
type: 'json',
|
||||
description: 'Minimum, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
max: {
|
||||
type: 'json',
|
||||
description: 'Maximum, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
preferredEbitda: {
|
||||
type: 'object',
|
||||
description: 'Preferred EBITDA, as a min and max monetary value',
|
||||
nullable: true,
|
||||
properties: {
|
||||
min: {
|
||||
type: 'json',
|
||||
description: 'Minimum, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
max: {
|
||||
type: 'json',
|
||||
description: 'Maximum, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
preferredEbit: {
|
||||
type: 'object',
|
||||
description: 'Preferred EBIT, as a min and max monetary value',
|
||||
nullable: true,
|
||||
properties: {
|
||||
min: {
|
||||
type: 'json',
|
||||
description: 'Minimum, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
max: {
|
||||
type: 'json',
|
||||
description: 'Maximum, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
preferredRevenue: {
|
||||
type: 'object',
|
||||
description: 'Preferred revenue, as a min and max monetary value',
|
||||
nullable: true,
|
||||
properties: {
|
||||
min: {
|
||||
type: 'json',
|
||||
description: 'Minimum, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
max: {
|
||||
type: 'json',
|
||||
description: 'Maximum, as a PitchBook monetary value',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
preferredInvestmentHorizon: {
|
||||
type: 'object',
|
||||
description: 'Preferred holding period in years',
|
||||
nullable: true,
|
||||
properties: {
|
||||
min: { type: 'number', description: 'Minimum years', nullable: true },
|
||||
max: { type: 'number', description: 'Maximum years', nullable: true },
|
||||
},
|
||||
},
|
||||
geographicalPreferences: {
|
||||
type: 'array',
|
||||
description: 'Regions the investor targets, from broad group down to state',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
regionGroup: { type: 'json', description: 'Broad region as a code and description pair' },
|
||||
regionSegment: {
|
||||
type: 'json',
|
||||
description: 'Region segment as a code and description pair',
|
||||
},
|
||||
regionCode: { type: 'json', description: 'Country as a code and description pair' },
|
||||
regionState: {
|
||||
type: 'json',
|
||||
description: 'State or province as a code and description pair',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
otherInvestmentPreferences: {
|
||||
type: 'array',
|
||||
description: 'Other stated preferences, such as preferring a minority stake',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Preference code' },
|
||||
description: { type: 'string', description: 'Preference label' },
|
||||
},
|
||||
},
|
||||
},
|
||||
preferredIndustry: {
|
||||
type: 'array',
|
||||
description: 'Industries the investor targets',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Industry code' },
|
||||
description: { type: 'string', description: 'Industry label' },
|
||||
},
|
||||
},
|
||||
},
|
||||
preferredDealTypes: {
|
||||
type: 'array',
|
||||
description: 'Deal types the investor targets',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Deal type code' },
|
||||
description: { type: 'string', description: 'Deal type label' },
|
||||
},
|
||||
},
|
||||
},
|
||||
preferredVerticals: {
|
||||
type: 'array',
|
||||
description: 'Verticals the investor targets',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Vertical code' },
|
||||
description: { type: 'string', description: 'Vertical label' },
|
||||
},
|
||||
},
|
||||
},
|
||||
assetPreferences: {
|
||||
type: 'array',
|
||||
description: 'Asset classes and subcategories the investor targets',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
assetClass: { type: 'json', description: 'Asset class as a code and description pair' },
|
||||
subcategory: { type: 'json', description: 'Subcategory as a code and description pair' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
import type {
|
||||
PitchbookInvestorSearchParams,
|
||||
PitchbookSearchResponse,
|
||||
} from '@/tools/pitchbook/types'
|
||||
import {
|
||||
buildSearchQuery,
|
||||
mapStats,
|
||||
PITCHBOOK_API_BASE,
|
||||
pitchbookAuthHeaders,
|
||||
throwIfNotOk,
|
||||
} from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookInvestorSearchTool: ToolConfig<
|
||||
PitchbookInvestorSearchParams,
|
||||
PitchbookSearchResponse
|
||||
> = {
|
||||
id: 'pitchbook_investor_search',
|
||||
name: 'PitchBook Investor Search',
|
||||
description:
|
||||
'Search PitchBook for investors by type, location, assets under management, fund profile, and deal activity',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
investorNames: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated investor names, PitchBook IDs, websites, or tickers',
|
||||
},
|
||||
investorType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook investor type code (e.g. LP_BI, LP_E)',
|
||||
},
|
||||
city: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'City the investor is located in',
|
||||
},
|
||||
stateProvince: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'State or province the investor is located in',
|
||||
},
|
||||
country: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Country the investor is located in (e.g. USA)',
|
||||
},
|
||||
locationType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Restrict location matching to HQ_ONLY, NON_HQ_ONLY, or ANY',
|
||||
},
|
||||
aum: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Assets under management in millions. Use >1000, <1000, or 100^1000 for a range',
|
||||
},
|
||||
dryPowder: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Dry powder in millions. Use >500, <500, or 1^500 for a range',
|
||||
},
|
||||
fundType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook fund type code of the investor funds',
|
||||
},
|
||||
fundSize: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Fund size in millions. Use >500, <500, or 1^500 for a range',
|
||||
},
|
||||
dealType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook deal type code the investor has participated in',
|
||||
},
|
||||
dealDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Deal date filter. Use >YYYY-MM-DD, <YYYY-MM-DD, or YYYY-MM-DD^YYYY-MM-DD for a range',
|
||||
},
|
||||
dealSize: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Deal size in millions. Use >100, <100, or 10^100 for a range',
|
||||
},
|
||||
preferredDealTypes: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Preferred deal type codes the investor targets',
|
||||
},
|
||||
industryPreferences: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Preferred industry codes the investor targets',
|
||||
},
|
||||
geographicalPreferences: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Preferred geography codes the investor targets',
|
||||
},
|
||||
filterCurrency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code the monetary filters on this search are expressed in, e.g. setting EUR means dealSize is read as millions of euros. Distinct from `currency`, which converts the values PitchBook returns.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
page: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Page of results to return, starting at 1',
|
||||
},
|
||||
perPage: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'How many results to return per page',
|
||||
},
|
||||
additionalFilters: {
|
||||
type: 'json',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Any other documented search filter, as a JSON object of query parameter names to values (e.g. {"emergingSpaces": "AGTECH"}). A dedicated field always wins over the same key set here.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const query = buildSearchQuery(
|
||||
{
|
||||
investorNames: params.investorNames,
|
||||
investorType: params.investorType,
|
||||
city: params.city,
|
||||
stateProvince: params.stateProvince,
|
||||
country: params.country,
|
||||
locationType: params.locationType,
|
||||
aum: params.aum,
|
||||
dryPowder: params.dryPowder,
|
||||
fundType: params.fundType,
|
||||
fundSize: params.fundSize,
|
||||
dealType: params.dealType,
|
||||
dealDate: params.dealDate,
|
||||
dealSize: params.dealSize,
|
||||
preferredDealTypes: params.preferredDealTypes,
|
||||
industryPreferences: params.industryPreferences,
|
||||
geographicalPreferences: params.geographicalPreferences,
|
||||
currency: params.filterCurrency,
|
||||
},
|
||||
{
|
||||
page: params.page,
|
||||
perPage: params.perPage,
|
||||
additionalFilters: params.additionalFilters,
|
||||
}
|
||||
)
|
||||
return `${PITCHBOOK_API_BASE}/investors/search${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to search investors')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stats: mapStats(data.stats),
|
||||
items: data.items ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stats: {
|
||||
type: 'object',
|
||||
description: 'Paging envelope for the result set',
|
||||
properties: {
|
||||
total: { type: 'number', description: 'Total number of matching results' },
|
||||
perPage: { type: 'number', description: 'Results returned per page' },
|
||||
page: { type: 'number', description: 'Current page number' },
|
||||
lastPage: { type: 'number', description: 'Number of the last available page' },
|
||||
},
|
||||
},
|
||||
items: {
|
||||
type: 'array',
|
||||
description: 'Investors matching the search criteria',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
investorId: { type: 'string', description: 'PitchBook investor ID' },
|
||||
investorName: { type: 'string', description: 'Investor name' },
|
||||
website: { type: 'string', description: 'Investor website', nullable: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import type { PitchbookResponse, PitchbookUpdatesParams } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookInvestorUpdatesTool: ToolConfig<PitchbookUpdatesParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_investor_updates',
|
||||
name: 'PitchBook Investor Updates',
|
||||
description:
|
||||
'Check which investor datasets changed in a window, so a sync only refetches what moved',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook investor ID, e.g. 58781-35.',
|
||||
},
|
||||
sinceDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Window to report changes over, carrying its operator in the value: >YYYY-MM-DD for after a date, <YYYY-MM-DD for before one, or YYYY-MM-DD^YYYY-MM-DD for a range. Use this or trailingRange.',
|
||||
},
|
||||
trailingRange: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Report changes over the last N days. Use this or sinceDate.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.sinceDate) qs.set('sinceDate', params.sinceDate)
|
||||
if (params.trailingRange !== undefined && params.trailingRange !== null) {
|
||||
qs.set('trailingRange', String(params.trailingRange))
|
||||
}
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/investors/${params.pbId.trim()}/updates${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch updates')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
updates: data.updates ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
updates: {
|
||||
type: 'json',
|
||||
description:
|
||||
'Map of dataset name to whether it changed in the window. Keys are PitchBook dataset names, so read it as a plain object.',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookLimitedPartnerActualAllocationsTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_limited_partner_actual_allocations',
|
||||
name: 'PitchBook Limited Partner Actual Allocations',
|
||||
description:
|
||||
'Retrieve a limited partner reported asset allocation across cash, equities, fixed income, private equity, real estate, and alternatives',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook limited partner ID, e.g. 58901-50.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) =>
|
||||
`${PITCHBOOK_API_BASE}/limited-partners/${params.pbId.trim()}/actual-allocations`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch limited partner actual allocations')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
limitedPartnerId: data.limitedPartnerId ?? null,
|
||||
limitedPartnerName: data.limitedPartnerName ?? null,
|
||||
affiliatedFunds: data.affiliatedFunds ?? null,
|
||||
affiliatedInvestors: data.affiliatedInvestors ?? null,
|
||||
allocations: data.allocations ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
limitedPartnerId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook limited partner ID',
|
||||
nullable: true,
|
||||
},
|
||||
limitedPartnerName: { type: 'string', description: 'Limited partner name', nullable: true },
|
||||
affiliatedFunds: { type: 'number', description: 'Number of affiliated funds', nullable: true },
|
||||
affiliatedInvestors: {
|
||||
type: 'number',
|
||||
description: 'Number of affiliated investors',
|
||||
nullable: true,
|
||||
},
|
||||
allocations: {
|
||||
type: 'array',
|
||||
description: 'Reported asset allocations',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
alternativeInvestments: {
|
||||
type: 'json',
|
||||
description: 'Amount allocated to alternative investments',
|
||||
nullable: true,
|
||||
},
|
||||
alternativeInvestmentsPercent: {
|
||||
type: 'json',
|
||||
description: 'Percentage of the portfolio allocated to alternative investments',
|
||||
nullable: true,
|
||||
},
|
||||
privateEquity: {
|
||||
type: 'object',
|
||||
description: 'Amount allocated to private equity',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
privateEquityPercent: {
|
||||
type: 'number',
|
||||
description: 'Percentage of the portfolio allocated to private equity',
|
||||
},
|
||||
realEstate: {
|
||||
type: 'object',
|
||||
description: 'Amount allocated to real estate',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
realEstatePercent: {
|
||||
type: 'number',
|
||||
description: 'Percentage of the portfolio allocated to real estate',
|
||||
},
|
||||
specialOpportunities: {
|
||||
type: 'json',
|
||||
description: 'Amount allocated to special opportunities',
|
||||
nullable: true,
|
||||
},
|
||||
specialOpportunitiePercent: {
|
||||
type: 'json',
|
||||
description: 'Percentage of the portfolio allocated to special opportunities',
|
||||
nullable: true,
|
||||
},
|
||||
hedgeFunds: {
|
||||
type: 'object',
|
||||
description: 'Amount allocated to hedge funds',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
hedgeFundsPercent: {
|
||||
type: 'number',
|
||||
description: 'Percentage of the portfolio allocated to hedge funds',
|
||||
},
|
||||
equities: {
|
||||
type: 'object',
|
||||
description: 'Amount allocated to equities',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
equitiesPercent: {
|
||||
type: 'number',
|
||||
description: 'Percentage of the portfolio allocated to equities',
|
||||
},
|
||||
fixedIncome: {
|
||||
type: 'object',
|
||||
description: 'Amount allocated to fixed income',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
fixedIncomePercent: {
|
||||
type: 'number',
|
||||
description: 'Percentage of the portfolio allocated to fixed income',
|
||||
},
|
||||
cash: {
|
||||
type: 'object',
|
||||
description: 'Amount allocated to cash',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
cashPercent: {
|
||||
type: 'number',
|
||||
description: 'Percentage of the portfolio allocated to cash',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookLimitedPartnerBioTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> =
|
||||
{
|
||||
id: 'pitchbook_limited_partner_bio',
|
||||
name: 'PitchBook Limited Partner Bio',
|
||||
description:
|
||||
'Retrieve the profile of a limited partner: names, description, type, assets under management, and staff',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook limited partner ID, e.g. 58901-50. Use a limited partner search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/limited-partners/${params.pbId.trim()}/bio`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch limited partner bio')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
limitedPartnerId: data.limitedPartnerId ?? null,
|
||||
limitedPartnerName: data.limitedPartnerName ?? null,
|
||||
description: data.description ?? null,
|
||||
assetsUnderManagement: data.assetsUnderManagement ?? null,
|
||||
yearFounded: data.yearFounded ?? null,
|
||||
website: data.website ?? null,
|
||||
managementStaff: data.managementStaff ?? null,
|
||||
limitedPartnerTypes: data.limitedPartnerTypes ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
limitedPartnerId: { type: 'string', description: 'PitchBook limited partner ID' },
|
||||
limitedPartnerName: {
|
||||
type: 'object',
|
||||
description: 'The names the limited partner is known by',
|
||||
properties: {
|
||||
formalName: { type: 'string', description: 'Formal name', nullable: true },
|
||||
alsoKnownAs: { type: 'string', description: 'Also-known-as name', nullable: true },
|
||||
legalName: { type: 'string', description: 'Registered legal name', nullable: true },
|
||||
formerlyKnownAs: { type: 'string', description: 'Previous name', nullable: true },
|
||||
},
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Description of the limited partner',
|
||||
nullable: true,
|
||||
},
|
||||
limitedPartnerTypes: {
|
||||
type: 'array',
|
||||
description: 'Types the limited partner is classified as, one flagged primary',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
type: {
|
||||
type: 'object',
|
||||
description: 'Limited partner type',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Type code' },
|
||||
description: { type: 'string', description: 'Type label' },
|
||||
},
|
||||
},
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary type' },
|
||||
},
|
||||
},
|
||||
},
|
||||
assetsUnderManagement: {
|
||||
type: 'object',
|
||||
description: 'Assets under management',
|
||||
nullable: true,
|
||||
properties: {
|
||||
amount: {
|
||||
type: 'number',
|
||||
description: 'Value in the requested currency',
|
||||
nullable: true,
|
||||
},
|
||||
currency: { type: 'string', description: 'Currency of amount', nullable: true },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
nullable: true,
|
||||
},
|
||||
nativeCurrency: {
|
||||
type: 'string',
|
||||
description: 'Currency of nativeAmount',
|
||||
nullable: true,
|
||||
},
|
||||
estimated: { type: 'boolean', description: 'Whether the value is a PitchBook estimate' },
|
||||
},
|
||||
},
|
||||
yearFounded: {
|
||||
type: 'number',
|
||||
description: 'Year the limited partner was founded',
|
||||
nullable: true,
|
||||
},
|
||||
website: { type: 'string', description: 'Limited partner website', nullable: true },
|
||||
managementStaff: {
|
||||
type: 'number',
|
||||
description: 'Number of management staff',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookLimitedPartnerCommitmentAggregatesTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_limited_partner_commitment_aggregates',
|
||||
name: 'PitchBook Limited Partner Commitment Aggregates',
|
||||
description:
|
||||
'Retrieve a limited partner commitments rolled up by fund type, both active and all-time',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook limited partner ID, e.g. 58901-50.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) =>
|
||||
`${PITCHBOOK_API_BASE}/limited-partners/${params.pbId.trim()}/commitments-aggregates`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch limited partner commitment aggregates')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
limitedPartnerId: data.limitedPartnerId ?? null,
|
||||
limitedPartnerName: data.limitedPartnerName ?? null,
|
||||
activeCommitmentsInDebtFunds: data.activeCommitmentsInDebtFunds ?? null,
|
||||
activeCommitmentsInPeFunds: data.activeCommitmentsInPeFunds ?? null,
|
||||
activeCommitmentsInReFunds: data.activeCommitmentsInReFunds ?? null,
|
||||
activeCommitmentsInVcFunds: data.activeCommitmentsInVcFunds ?? null,
|
||||
activeCommitmentsInFoFsAnd2nd: data.activeCommitmentsInFoFsAnd2nd ?? null,
|
||||
activeCommitmentsInInfrastructure: data.activeCommitmentsInInfrastructure ?? null,
|
||||
activeCommitmentsInEnergyFunds: data.activeCommitmentsInEnergyFunds ?? null,
|
||||
activeCommitmentsInOtherFunds: data.activeCommitmentsInOtherFunds ?? null,
|
||||
totalActiveCommitments: data.totalActiveCommitments ?? null,
|
||||
totalCommitmentsInDebtFunds: data.totalCommitmentsInDebtFunds ?? null,
|
||||
totalCommitmentsInPeFunds: data.totalCommitmentsInPeFunds ?? null,
|
||||
totalCommitmentsInReFunds: data.totalCommitmentsInReFunds ?? null,
|
||||
totalCommitmentsInVcFunds: data.totalCommitmentsInVcFunds ?? null,
|
||||
totalCommitmentsInFoFsAnd2nd: data.totalCommitmentsInFoFsAnd2nd ?? null,
|
||||
totalCommitmentsInInfrastructure: data.totalCommitmentsInInfrastructure ?? null,
|
||||
totalCommitmentsInEnergyFunds: data.totalCommitmentsInEnergyFunds ?? null,
|
||||
totalCommitmentsInOtherFunds: data.totalCommitmentsInOtherFunds ?? null,
|
||||
totalCommitments: data.totalCommitments ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
limitedPartnerId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook limited partner ID',
|
||||
nullable: true,
|
||||
},
|
||||
limitedPartnerName: { type: 'string', description: 'Limited partner name', nullable: true },
|
||||
activeCommitmentsInDebtFunds: {
|
||||
type: 'json',
|
||||
description: 'Number of active commitments to debt funds',
|
||||
nullable: true,
|
||||
},
|
||||
activeCommitmentsInPeFunds: {
|
||||
type: 'number',
|
||||
description: 'Number of active commitments to PE funds',
|
||||
nullable: true,
|
||||
},
|
||||
activeCommitmentsInReFunds: {
|
||||
type: 'number',
|
||||
description: 'Number of active commitments to real estate funds',
|
||||
nullable: true,
|
||||
},
|
||||
activeCommitmentsInVcFunds: {
|
||||
type: 'number',
|
||||
description: 'Number of active commitments to VC funds',
|
||||
nullable: true,
|
||||
},
|
||||
activeCommitmentsInFoFsAnd2nd: {
|
||||
type: 'json',
|
||||
description: 'Number of active commitments to funds of funds and secondaries',
|
||||
nullable: true,
|
||||
},
|
||||
activeCommitmentsInInfrastructure: {
|
||||
type: 'json',
|
||||
description: 'Number of active commitments to infrastructure funds',
|
||||
nullable: true,
|
||||
},
|
||||
activeCommitmentsInEnergyFunds: {
|
||||
type: 'json',
|
||||
description: 'Number of active commitments to energy funds',
|
||||
nullable: true,
|
||||
},
|
||||
activeCommitmentsInOtherFunds: {
|
||||
type: 'number',
|
||||
description: 'Number of active commitments to other funds',
|
||||
nullable: true,
|
||||
},
|
||||
totalActiveCommitments: {
|
||||
type: 'number',
|
||||
description: 'Number of active commitments',
|
||||
nullable: true,
|
||||
},
|
||||
totalCommitmentsInDebtFunds: {
|
||||
type: 'json',
|
||||
description: 'Number of all commitments to debt funds',
|
||||
nullable: true,
|
||||
},
|
||||
totalCommitmentsInPeFunds: {
|
||||
type: 'number',
|
||||
description: 'Number of all commitments to PE funds',
|
||||
nullable: true,
|
||||
},
|
||||
totalCommitmentsInReFunds: {
|
||||
type: 'number',
|
||||
description: 'Number of all commitments to real estate funds',
|
||||
nullable: true,
|
||||
},
|
||||
totalCommitmentsInVcFunds: {
|
||||
type: 'number',
|
||||
description: 'Number of all commitments to VC funds',
|
||||
nullable: true,
|
||||
},
|
||||
totalCommitmentsInFoFsAnd2nd: {
|
||||
type: 'json',
|
||||
description: 'Number of all commitments to funds of funds and secondaries',
|
||||
nullable: true,
|
||||
},
|
||||
totalCommitmentsInInfrastructure: {
|
||||
type: 'json',
|
||||
description: 'Number of all commitments to infrastructure funds',
|
||||
nullable: true,
|
||||
},
|
||||
totalCommitmentsInEnergyFunds: {
|
||||
type: 'json',
|
||||
description: 'Number of all commitments to energy funds',
|
||||
nullable: true,
|
||||
},
|
||||
totalCommitmentsInOtherFunds: {
|
||||
type: 'number',
|
||||
description: 'Number of all commitments to other funds',
|
||||
nullable: true,
|
||||
},
|
||||
totalCommitments: {
|
||||
type: 'number',
|
||||
description: 'Number of commitments ever made',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookLimitedPartnerCommitmentPreferencesTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_limited_partner_commitment_preferences',
|
||||
name: 'PitchBook Limited Partner Commitment Preferences',
|
||||
description:
|
||||
'Retrieve what a limited partner commits to: preferred commitment size, fund types, and geographies',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook limited partner ID, e.g. 58901-50.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) =>
|
||||
`${PITCHBOOK_API_BASE}/limited-partners/${params.pbId.trim()}/commitment-prefs`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch limited partner commitment preferences')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
limitedPartnerId: data.limitedPartnerId ?? null,
|
||||
limitedPartnerName: data.limitedPartnerName ?? null,
|
||||
preferredCommitmentSize: data.preferredCommitmentSize ?? null,
|
||||
preferredGeography: data.preferredGeography ?? [],
|
||||
preferredFundTypes: data.preferredFundTypes ?? [],
|
||||
preferredDirectInvestmentSize: data.preferredDirectInvestmentSize ?? null,
|
||||
otherInvestmentPreferences: data.otherInvestmentPreferences ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
limitedPartnerId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook limited partner ID',
|
||||
nullable: true,
|
||||
},
|
||||
limitedPartnerName: { type: 'string', description: 'Limited partner name', nullable: true },
|
||||
preferredCommitmentSize: {
|
||||
type: 'json',
|
||||
description: 'Preferred commitment size',
|
||||
nullable: true,
|
||||
},
|
||||
preferredGeography: {
|
||||
type: 'array',
|
||||
description: 'Regions the limited partner targets',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
preferredFundTypes: {
|
||||
type: 'array',
|
||||
description: 'Fund types the limited partner targets',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
preferredDirectInvestmentSize: {
|
||||
type: 'json',
|
||||
description: 'Preferred direct investment size',
|
||||
nullable: true,
|
||||
},
|
||||
otherInvestmentPreferences: {
|
||||
type: 'array',
|
||||
description: 'Other stated preferences',
|
||||
items: { type: 'json' },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookLimitedPartnerCommitmentsDetailedTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_limited_partner_commitments_detailed',
|
||||
name: 'PitchBook Limited Partner Commitments',
|
||||
description:
|
||||
'Retrieve every fund commitment a limited partner has made, with date, size, status, and the managers behind each fund',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook limited partner ID, e.g. 58901-50.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) =>
|
||||
`${PITCHBOOK_API_BASE}/limited-partners/${params.pbId.trim()}/commitments-detailed`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch limited partner commitments')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
commitments: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
commitments: {
|
||||
type: 'array',
|
||||
description: 'Fund commitments the limited partner has made',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
limitedPartnerId: { type: 'string', description: 'PitchBook limited partner ID' },
|
||||
committedFundId: { type: 'string', description: 'PitchBook ID of the fund committed to' },
|
||||
committedFundName: { type: 'string', description: 'Name of the fund committed to' },
|
||||
committedInvestors: {
|
||||
type: 'array',
|
||||
description: 'Managers of the fund committed to',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
committedInvestorName: { type: 'string', description: 'Name of the fund manager' },
|
||||
committedInvestorId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the fund manager',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
commitmentDate: {
|
||||
type: 'string',
|
||||
description: 'Date of the commitment (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
commitmentSize: {
|
||||
type: 'object',
|
||||
description: 'Size of the commitment',
|
||||
nullable: true,
|
||||
properties: {
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
},
|
||||
},
|
||||
commitmentStatus: {
|
||||
type: 'object',
|
||||
description: 'Status of the commitment',
|
||||
nullable: true,
|
||||
properties: {
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
commitmentType: {
|
||||
type: 'object',
|
||||
description: 'Type of the commitment',
|
||||
nullable: true,
|
||||
properties: {
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
import type {
|
||||
PitchbookLimitedPartnerSearchParams,
|
||||
PitchbookSearchResponse,
|
||||
} from '@/tools/pitchbook/types'
|
||||
import {
|
||||
buildSearchQuery,
|
||||
mapStats,
|
||||
PITCHBOOK_API_BASE,
|
||||
pitchbookAuthHeaders,
|
||||
throwIfNotOk,
|
||||
} from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookLimitedPartnerSearchTool: ToolConfig<
|
||||
PitchbookLimitedPartnerSearchParams,
|
||||
PitchbookSearchResponse
|
||||
> = {
|
||||
id: 'pitchbook_limited_partner_search',
|
||||
name: 'PitchBook Limited Partner Search',
|
||||
description:
|
||||
'Search PitchBook for limited partners by type, location, assets under management, and commitment activity',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
limitedPartnerNames: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated limited partner names or PitchBook IDs',
|
||||
},
|
||||
limitedPartnerType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook limited partner type code',
|
||||
},
|
||||
city: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'City the limited partner is located in',
|
||||
},
|
||||
stateProvince: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'State or province the limited partner is located in',
|
||||
},
|
||||
country: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Country the limited partner is located in (e.g. USA)',
|
||||
},
|
||||
locationType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Restrict location matching to HQ_ONLY, NON_HQ_ONLY, or ANY',
|
||||
},
|
||||
aum: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Assets under management in millions. Use >1000, <1000, or 100^1000 for a range',
|
||||
},
|
||||
numberOfCommitments: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of fund commitments. Use >1000, <1000, or 10^100 for a range',
|
||||
},
|
||||
commitmentSize: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Commitment size in millions. Use >100, <100, or 10^100 for a range',
|
||||
},
|
||||
commitmentDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Commitment date filter. Use >YYYY-MM-DD, <YYYY-MM-DD, or YYYY-MM-DD^YYYY-MM-DD for a range',
|
||||
},
|
||||
fundType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook fund type code the limited partner commits to',
|
||||
},
|
||||
filterCurrency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code the monetary filters on this search are expressed in, e.g. setting EUR means dealSize is read as millions of euros. Distinct from `currency`, which converts the values PitchBook returns.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
page: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Page of results to return, starting at 1',
|
||||
},
|
||||
perPage: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'How many results to return per page',
|
||||
},
|
||||
additionalFilters: {
|
||||
type: 'json',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Any other documented search filter, as a JSON object of query parameter names to values (e.g. {"emergingSpaces": "AGTECH"}). A dedicated field always wins over the same key set here.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const query = buildSearchQuery(
|
||||
{
|
||||
limitedPartnerNames: params.limitedPartnerNames,
|
||||
limitedPartnerType: params.limitedPartnerType,
|
||||
city: params.city,
|
||||
stateProvince: params.stateProvince,
|
||||
country: params.country,
|
||||
locationType: params.locationType,
|
||||
aum: params.aum,
|
||||
numberOfCommitments: params.numberOfCommitments,
|
||||
commitmentSize: params.commitmentSize,
|
||||
commitmentDate: params.commitmentDate,
|
||||
fundType: params.fundType,
|
||||
currency: params.filterCurrency,
|
||||
},
|
||||
{
|
||||
page: params.page,
|
||||
perPage: params.perPage,
|
||||
additionalFilters: params.additionalFilters,
|
||||
}
|
||||
)
|
||||
return `${PITCHBOOK_API_BASE}/limited-partners/search${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to search limited partners')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stats: mapStats(data.stats),
|
||||
items: data.items ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stats: {
|
||||
type: 'object',
|
||||
description: 'Paging envelope for the result set',
|
||||
properties: {
|
||||
total: { type: 'number', description: 'Total number of matching results' },
|
||||
perPage: { type: 'number', description: 'Results returned per page' },
|
||||
page: { type: 'number', description: 'Current page number' },
|
||||
lastPage: { type: 'number', description: 'Number of the last available page' },
|
||||
},
|
||||
},
|
||||
items: {
|
||||
type: 'array',
|
||||
description: 'Limited partners matching the search criteria',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
limitedPartnerId: { type: 'string', description: 'PitchBook limited partner ID' },
|
||||
limitedPartnerName: { type: 'string', description: 'Limited partner name' },
|
||||
website: { type: 'string', description: 'Limited partner website', nullable: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookLimitedPartnerServiceProvidersTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_limited_partner_service_providers',
|
||||
name: 'PitchBook Limited Partner Service Providers',
|
||||
description: 'Retrieve the current and former service providers engaged by a limited partner',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook limited partner ID, e.g. 58901-50.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) =>
|
||||
`${PITCHBOOK_API_BASE}/limited-partners/${params.pbId.trim()}/service-providers`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch limited partner service providers')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
limitedPartnerId: data.limitedPartnerId ?? null,
|
||||
currentGeneralServices: data.currentGeneralServices ?? [],
|
||||
formerGeneralServices: data.formerGeneralServices ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
limitedPartnerId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook limited partner ID',
|
||||
nullable: true,
|
||||
},
|
||||
currentGeneralServices: {
|
||||
type: 'array',
|
||||
description: 'Current general service relationships',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
serviceProviderId: { type: 'string', description: 'PitchBook service provider ID' },
|
||||
serviceProviderName: { type: 'string', description: 'Service provider name' },
|
||||
serviceProviderTypes: {
|
||||
type: 'array',
|
||||
description: 'Types the service provider is classified as',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary entry' },
|
||||
type: {
|
||||
type: 'object',
|
||||
description: 'Type as a code and description pair',
|
||||
properties: {
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
},
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
serviceProvided: {
|
||||
type: 'object',
|
||||
description: 'Service provided, as a code and description pair',
|
||||
properties: {
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
formerGeneralServices: {
|
||||
type: 'array',
|
||||
description: 'Former general service relationships',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
serviceProviderId: { type: 'string', description: 'PitchBook service provider ID' },
|
||||
serviceProviderName: { type: 'string', description: 'Service provider name' },
|
||||
serviceProviderTypes: {
|
||||
type: 'array',
|
||||
description: 'Types the service provider is classified as',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary entry' },
|
||||
type: {
|
||||
type: 'object',
|
||||
description: 'Type as a code and description pair',
|
||||
properties: {
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Human-readable label for the code',
|
||||
},
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
serviceProvided: {
|
||||
type: 'object',
|
||||
description: 'Service provided, as a code and description pair',
|
||||
properties: {
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,316 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookLimitedPartnerTargetAllocationsTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_limited_partner_target_allocations',
|
||||
name: 'PitchBook Limited Partner Target Allocations',
|
||||
description:
|
||||
'Retrieve a limited partner target allocation ranges per asset class, in both value and percentage terms',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook limited partner ID, e.g. 58901-50.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) =>
|
||||
`${PITCHBOOK_API_BASE}/limited-partners/${params.pbId.trim()}/target-allocations`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch limited partner target allocations')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
limitedPartnerId: data.limitedPartnerId ?? null,
|
||||
limitedPartnerName: data.limitedPartnerName ?? null,
|
||||
targetAllocations: data.targetAllocations ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
limitedPartnerId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook limited partner ID',
|
||||
nullable: true,
|
||||
},
|
||||
limitedPartnerName: { type: 'string', description: 'Limited partner name', nullable: true },
|
||||
targetAllocations: {
|
||||
type: 'array',
|
||||
description: 'Target asset allocations',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
policyDescription: { type: 'string', description: 'Allocation policy description' },
|
||||
alternativesMin: { type: 'json', description: 'Alternatives min', nullable: true },
|
||||
alternativesPercentMin: {
|
||||
type: 'json',
|
||||
description: 'Alternatives percent min',
|
||||
nullable: true,
|
||||
},
|
||||
alternativesMax: { type: 'json', description: 'Alternatives max', nullable: true },
|
||||
alternativesPercentMax: {
|
||||
type: 'json',
|
||||
description: 'Alternatives percent max',
|
||||
nullable: true,
|
||||
},
|
||||
privateEquityMin: {
|
||||
type: 'object',
|
||||
description: 'Minimum target allocation to private equity',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
privateEquityPercentMin: {
|
||||
type: 'number',
|
||||
description: 'Minimum target allocation to private equity, as a percentage',
|
||||
},
|
||||
privateEquityMax: {
|
||||
type: 'object',
|
||||
description: 'Maximum target allocation to private equity',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
privateEquityPercentMax: {
|
||||
type: 'number',
|
||||
description: 'Maximum target allocation to private equity, as a percentage',
|
||||
},
|
||||
realEstateMin: {
|
||||
type: 'object',
|
||||
description: 'Minimum target allocation to real estate',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
realEstatePercentMin: {
|
||||
type: 'number',
|
||||
description: 'Minimum target allocation to real estate, as a percentage',
|
||||
},
|
||||
realEstateMax: {
|
||||
type: 'object',
|
||||
description: 'Maximum target allocation to real estate',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
realEstatePercentMax: {
|
||||
type: 'number',
|
||||
description: 'Maximum target allocation to real estate, as a percentage',
|
||||
},
|
||||
specialOpportunitiesMin: {
|
||||
type: 'json',
|
||||
description: 'Minimum target allocation to special opportunities',
|
||||
nullable: true,
|
||||
},
|
||||
specialOpportunitiesPercentMin: {
|
||||
type: 'json',
|
||||
description: 'Minimum target allocation to special opportunities, as a percentage',
|
||||
nullable: true,
|
||||
},
|
||||
specialOpportunitiesMax: {
|
||||
type: 'json',
|
||||
description: 'Maximum target allocation to special opportunities',
|
||||
nullable: true,
|
||||
},
|
||||
specialOpportunitiesPercentMax: {
|
||||
type: 'json',
|
||||
description: 'Maximum target allocation to special opportunities, as a percentage',
|
||||
nullable: true,
|
||||
},
|
||||
hedgeFundsMin: {
|
||||
type: 'json',
|
||||
description: 'Minimum target allocation to hedge funds',
|
||||
nullable: true,
|
||||
},
|
||||
hedgeFundsPercentMin: {
|
||||
type: 'json',
|
||||
description: 'Minimum target allocation to hedge funds, as a percentage',
|
||||
nullable: true,
|
||||
},
|
||||
hedgeFundsMax: {
|
||||
type: 'json',
|
||||
description: 'Maximum target allocation to hedge funds',
|
||||
nullable: true,
|
||||
},
|
||||
hedgeFundsPercentMax: {
|
||||
type: 'json',
|
||||
description: 'Maximum target allocation to hedge funds, as a percentage',
|
||||
nullable: true,
|
||||
},
|
||||
equitiesMin: {
|
||||
type: 'object',
|
||||
description: 'Minimum target allocation to equities',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
equitiesPercentMin: {
|
||||
type: 'number',
|
||||
description: 'Minimum target allocation to equities, as a percentage',
|
||||
},
|
||||
equitiesMax: {
|
||||
type: 'object',
|
||||
description: 'Maximum target allocation to equities',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
equitiesPercentMax: {
|
||||
type: 'number',
|
||||
description: 'Maximum target allocation to equities, as a percentage',
|
||||
},
|
||||
fixedIncomeMin: {
|
||||
type: 'object',
|
||||
description: 'Minimum target allocation to fixed income',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
fixedIncomePercentMin: {
|
||||
type: 'number',
|
||||
description: 'Minimum target allocation to fixed income, as a percentage',
|
||||
},
|
||||
fixedIncomeMax: {
|
||||
type: 'object',
|
||||
description: 'Maximum target allocation to fixed income',
|
||||
properties: {
|
||||
amount: { type: 'number', description: 'Value in the requested currency' },
|
||||
currency: { type: 'string', description: 'Currency of amount' },
|
||||
nativeAmount: {
|
||||
type: 'number',
|
||||
description: 'Value in the currency it was originally reported in',
|
||||
},
|
||||
nativeCurrency: { type: 'string', description: 'Currency of nativeAmount' },
|
||||
estimated: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the value is a PitchBook estimate',
|
||||
},
|
||||
},
|
||||
},
|
||||
fixedIncomePercentMax: {
|
||||
type: 'number',
|
||||
description: 'Maximum target allocation to fixed income, as a percentage',
|
||||
},
|
||||
cashMin: {
|
||||
type: 'json',
|
||||
description: 'Minimum target allocation to cash',
|
||||
nullable: true,
|
||||
},
|
||||
cashPercentMin: {
|
||||
type: 'json',
|
||||
description: 'Minimum target allocation to cash, as a percentage',
|
||||
nullable: true,
|
||||
},
|
||||
cashMax: {
|
||||
type: 'json',
|
||||
description: 'Maximum target allocation to cash',
|
||||
nullable: true,
|
||||
},
|
||||
cashPercentMax: {
|
||||
type: 'json',
|
||||
description: 'Maximum target allocation to cash, as a percentage',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
import type { PitchbookResponse, PitchbookUpdatesParams } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookLimitedPartnerUpdatesTool: ToolConfig<
|
||||
PitchbookUpdatesParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_limited_partner_updates',
|
||||
name: 'PitchBook Limited Partner Updates',
|
||||
description:
|
||||
'Check which limited partner datasets changed in a window, so a sync only refetches what moved',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook limited partner ID, e.g. 58901-50.',
|
||||
},
|
||||
sinceDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Window to report changes over, carrying its operator in the value: >YYYY-MM-DD for after a date, <YYYY-MM-DD for before one, or YYYY-MM-DD^YYYY-MM-DD for a range. Use this or trailingRange.',
|
||||
},
|
||||
trailingRange: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Report changes over the last N days. Use this or sinceDate.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.sinceDate) qs.set('sinceDate', params.sinceDate)
|
||||
if (params.trailingRange !== undefined && params.trailingRange !== null) {
|
||||
qs.set('trailingRange', String(params.trailingRange))
|
||||
}
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/limited-partners/${params.pbId.trim()}/updates${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch updates')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
updates: data.updates ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
updates: {
|
||||
type: 'json',
|
||||
description:
|
||||
'Map of dataset name to whether it changed in the window. Keys are PitchBook dataset names, so read it as a plain object.',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import type { PitchbookBaseParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookLookupTableStructureTool: ToolConfig<PitchbookBaseParams, PitchbookResponse> =
|
||||
{
|
||||
id: 'pitchbook_lookup_table_structure',
|
||||
name: 'PitchBook Lookup Table Structure',
|
||||
description:
|
||||
'List the lookup tables backing the search endpoints. Use this to find which table holds the codes a search filter expects.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/lookup-tables/structure`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch lookup table structure')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
tables: Array.isArray(data) ? data : [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
tables: {
|
||||
type: 'array',
|
||||
description: 'Lookup tables available',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
tableName: { type: 'string', description: 'Lookup table name' },
|
||||
tableDescription: { type: 'string', description: 'What the lookup table contains' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
import type { PitchbookLookupTablesParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookLookupTablesTool: ToolConfig<PitchbookLookupTablesParams, PitchbookResponse> =
|
||||
{
|
||||
id: 'pitchbook_lookup_tables',
|
||||
name: 'PitchBook Lookup Tables',
|
||||
description:
|
||||
'Retrieve the codes in one or more lookup tables. These are the codes the search filters expect, such as INDUSTRY or VERTICAL.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
tableNames: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Lookup tables to return, e.g. INDUSTRY or VERTICAL. Separate multiple names with a comma. Use the lookup table structure operation to see what is available.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
qs.set('tableNames', params.tableNames.trim())
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/lookup-tables${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch lookup tables')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
items: data.items ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
items: {
|
||||
type: 'array',
|
||||
description: 'Records returned',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
tableName: { type: 'string', description: 'Lookup table name' },
|
||||
tableDescription: { type: 'string', description: 'What the lookup table contains' },
|
||||
codes: {
|
||||
type: 'array',
|
||||
description: 'Codes in the lookup table',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookPatentDetailedTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_patent_detailed',
|
||||
name: 'PitchBook Patent Detail',
|
||||
description:
|
||||
'Retrieve the full record for a single patent: title, status, dates, assignees, inventors, citations, and claim counts',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Patent ID, e.g. EP-3167426-B1. Patent IDs come from a patent search.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/companies/patents/${params.pbId.trim()}/detailed`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch patent detail')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
patentId: data.patentId ?? null,
|
||||
patentTitle: data.patentTitle ?? null,
|
||||
status: data.status ?? null,
|
||||
publicationDate: data.publicationDate ?? null,
|
||||
firstFilingDate: data.firstFilingDate ?? null,
|
||||
expirationDate: data.expirationDate ?? null,
|
||||
filingAuthorityLocation: data.filingAuthorityLocation ?? null,
|
||||
cpcSection: data.cpcSection ?? null,
|
||||
cpcClass: data.cpcClass ?? null,
|
||||
cpcSubclass: data.cpcSubclass ?? null,
|
||||
currentAssigneeNames: data.currentAssigneeNames ?? [],
|
||||
originalAssigneeNames: data.originalAssigneeNames ?? [],
|
||||
mostRecentLegalStatus: data.mostRecentLegalStatus ?? null,
|
||||
mostRecentLegalStatusDate: data.mostRecentLegalStatusDate ?? null,
|
||||
applicationDate: data.applicationDate ?? null,
|
||||
grantDate: data.grantDate ?? null,
|
||||
familyId: data.familyId ?? null,
|
||||
inventors: data.inventors ?? [],
|
||||
documentForwardCitations: data.documentForwardCitations ?? null,
|
||||
documentBackwardCitations: data.documentBackwardCitations ?? null,
|
||||
countOfClaims: data.countOfClaims ?? null,
|
||||
countOfIndependentClaims: data.countOfIndependentClaims ?? null,
|
||||
patentDownloadUrl: data.patentDownloadUrl ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
patentId: { type: 'string', description: 'Patent ID', nullable: true },
|
||||
patentTitle: { type: 'string', description: 'Patent title', nullable: true },
|
||||
status: { type: 'string', description: 'Status', nullable: true },
|
||||
publicationDate: {
|
||||
type: 'string',
|
||||
description: 'Publication date (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
firstFilingDate: {
|
||||
type: 'string',
|
||||
description: 'First filing date (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
expirationDate: { type: 'json', description: 'Expiration date (YYYY-MM-DD)', nullable: true },
|
||||
filingAuthorityLocation: {
|
||||
type: 'string',
|
||||
description: 'Filing authority location',
|
||||
nullable: true,
|
||||
},
|
||||
cpcSection: {
|
||||
type: 'object',
|
||||
description: 'CPC section',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
cpcClass: {
|
||||
type: 'object',
|
||||
description: 'CPC class',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
cpcSubclass: {
|
||||
type: 'object',
|
||||
description: 'CPC subclass',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
currentAssigneeNames: {
|
||||
type: 'array',
|
||||
description: 'Current assignees',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
originalAssigneeNames: {
|
||||
type: 'array',
|
||||
description: 'Original assignees',
|
||||
items: { type: 'json' },
|
||||
},
|
||||
mostRecentLegalStatus: {
|
||||
type: 'string',
|
||||
description: 'Most recent legal status',
|
||||
nullable: true,
|
||||
},
|
||||
mostRecentLegalStatusDate: {
|
||||
type: 'string',
|
||||
description: 'Date of the most recent legal status (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
applicationDate: {
|
||||
type: 'string',
|
||||
description: 'Application date (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
grantDate: { type: 'string', description: 'Grant date (YYYY-MM-DD)', nullable: true },
|
||||
familyId: { type: 'string', description: 'Patent family ID', nullable: true },
|
||||
inventors: {
|
||||
type: 'array',
|
||||
description: 'Named inventors',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
documentForwardCitations: {
|
||||
type: 'number',
|
||||
description: 'Number of forward citations',
|
||||
nullable: true,
|
||||
},
|
||||
documentBackwardCitations: {
|
||||
type: 'number',
|
||||
description: 'Number of backward citations',
|
||||
nullable: true,
|
||||
},
|
||||
countOfClaims: { type: 'number', description: 'Number of claims', nullable: true },
|
||||
countOfIndependentClaims: {
|
||||
type: 'number',
|
||||
description: 'Number of independent claims',
|
||||
nullable: true,
|
||||
},
|
||||
patentDownloadUrl: {
|
||||
type: 'string',
|
||||
description: 'Link to download the patent document',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
import type { PitchbookPatentSearchParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import {
|
||||
mapStats,
|
||||
PITCHBOOK_API_BASE,
|
||||
pitchbookAuthHeaders,
|
||||
throwIfNotOk,
|
||||
} from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookPatentSearchTool: ToolConfig<PitchbookPatentSearchParams, PitchbookResponse> =
|
||||
{
|
||||
id: 'pitchbook_patent_search',
|
||||
name: 'PitchBook Patent Search',
|
||||
description:
|
||||
'Search the patents held by a company by status, filing and publication date, authority, and CPC classification',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook company ID, e.g. 10618-03. Use PitchBook Search to resolve a name to an ID.',
|
||||
},
|
||||
status: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Patent status: Active, Pending, or Inactive. Separate multiple values with a comma.',
|
||||
},
|
||||
publicationDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Publication date filter. Use >YYYY-MM-DD, <YYYY-MM-DD, or YYYY-MM-DD^YYYY-MM-DD for a range.',
|
||||
},
|
||||
firstFilingDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'First filing date filter. Use >YYYY-MM-DD, <YYYY-MM-DD, or YYYY-MM-DD^YYYY-MM-DD for a range.',
|
||||
},
|
||||
filingAuthorityLocation: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Filing authority location, e.g. EP or US. Separate multiple values with a comma.',
|
||||
},
|
||||
cpcSectionCode: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'CPC section code. Separate multiple values with a comma.',
|
||||
},
|
||||
cpcClassCode: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'CPC class code. Separate multiple values with a comma.',
|
||||
},
|
||||
page: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Page of results to return, starting at 1',
|
||||
},
|
||||
perPage: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'How many results to return per page',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.status) qs.set('status', params.status)
|
||||
if (params.publicationDate) qs.set('publicationDate', params.publicationDate)
|
||||
if (params.firstFilingDate) qs.set('firstFilingDate', params.firstFilingDate)
|
||||
if (params.filingAuthorityLocation) {
|
||||
qs.set('filingAuthorityLocation', params.filingAuthorityLocation)
|
||||
}
|
||||
if (params.cpcSectionCode) qs.set('cpcSectionCode', params.cpcSectionCode)
|
||||
if (params.cpcClassCode) qs.set('cpcClassCode', params.cpcClassCode)
|
||||
if (params.page !== undefined && params.page !== null) qs.set('page', String(params.page))
|
||||
if (params.perPage !== undefined && params.perPage !== null) {
|
||||
qs.set('perPage', String(params.perPage))
|
||||
}
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/companies/${params.pbId.trim()}/patents/search${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to search patents')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
companyId: data.companyId ?? null,
|
||||
stats: mapStats(data.stats),
|
||||
items: data.items ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID' },
|
||||
stats: {
|
||||
type: 'object',
|
||||
description: 'Summary statistics for the response',
|
||||
properties: {
|
||||
total: { type: 'number', description: 'Total number of matching results' },
|
||||
perPage: { type: 'number', description: 'Results returned per page' },
|
||||
page: { type: 'number', description: 'Current page number' },
|
||||
lastPage: { type: 'number', description: 'Number of the last available page' },
|
||||
},
|
||||
},
|
||||
items: {
|
||||
type: 'array',
|
||||
description: 'Records returned',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
patentId: { type: 'string', description: 'Patent ID' },
|
||||
patentTitle: { type: 'string', description: 'Patent title' },
|
||||
status: { type: 'string', description: 'Status' },
|
||||
publicationDate: { type: 'string', description: 'Publication date (YYYY-MM-DD)' },
|
||||
firstFilingDate: { type: 'string', description: 'First filing date (YYYY-MM-DD)' },
|
||||
expirationDate: { type: 'string', description: 'Expiration date (YYYY-MM-DD)' },
|
||||
filingAuthorityLocation: { type: 'string', description: 'Filing authority location' },
|
||||
cpcSection: {
|
||||
type: 'object',
|
||||
description: 'CPC section',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
cpcClass: {
|
||||
type: 'object',
|
||||
description: 'CPC class',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
cpcSubclass: {
|
||||
type: 'object',
|
||||
description: 'CPC subclass',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
import type { PitchbookPeopleSearchParams, PitchbookSearchResponse } from '@/tools/pitchbook/types'
|
||||
import {
|
||||
buildSearchQuery,
|
||||
mapStats,
|
||||
PITCHBOOK_API_BASE,
|
||||
pitchbookAuthHeaders,
|
||||
throwIfNotOk,
|
||||
} from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookPeopleSearchTool: ToolConfig<
|
||||
PitchbookPeopleSearchParams,
|
||||
PitchbookSearchResponse
|
||||
> = {
|
||||
id: 'pitchbook_people_search',
|
||||
name: 'PitchBook People Search',
|
||||
description: 'Search PitchBook for people by name, employer, position, education, and location',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
personNames: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated person names or PitchBook person IDs',
|
||||
},
|
||||
firstName: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'First name of the person',
|
||||
},
|
||||
lastName: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Last name of the person',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Email address of the person',
|
||||
},
|
||||
firmNames: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Comma-separated firm names, PitchBook IDs, websites, or tickers the person is associated with',
|
||||
},
|
||||
firmType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook firm type code of the associated firm',
|
||||
},
|
||||
positionLevel: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated position level codes (e.g. CEO, CFO, CIO)',
|
||||
},
|
||||
positionTitle: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Position title to match (e.g. Chief Executive Officer)',
|
||||
},
|
||||
department: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Department code the person works in',
|
||||
},
|
||||
university: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'University the person attended',
|
||||
},
|
||||
biography: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Keywords appearing in the person biography',
|
||||
},
|
||||
city: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'City the person is located in',
|
||||
},
|
||||
country: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Country the person is located in (e.g. USA)',
|
||||
},
|
||||
industry: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook industry code of the associated firm',
|
||||
},
|
||||
verticals: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook vertical code of the associated firm',
|
||||
},
|
||||
primaryPositionOnly: {
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Only match the person primary position rather than any position they hold',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
page: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Page of results to return, starting at 1',
|
||||
},
|
||||
perPage: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'How many results to return per page',
|
||||
},
|
||||
additionalFilters: {
|
||||
type: 'json',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Any other documented search filter, as a JSON object of query parameter names to values (e.g. {"emergingSpaces": "AGTECH"}). A dedicated field always wins over the same key set here.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const query = buildSearchQuery(
|
||||
{
|
||||
personNames: params.personNames,
|
||||
firstName: params.firstName,
|
||||
lastName: params.lastName,
|
||||
email: params.email,
|
||||
firmNames: params.firmNames,
|
||||
firmType: params.firmType,
|
||||
positionLevel: params.positionLevel,
|
||||
positionTitle: params.positionTitle,
|
||||
department: params.department,
|
||||
university: params.university,
|
||||
biography: params.biography,
|
||||
city: params.city,
|
||||
country: params.country,
|
||||
industry: params.industry,
|
||||
verticals: params.verticals,
|
||||
primaryPositionOnly: params.primaryPositionOnly,
|
||||
},
|
||||
{
|
||||
page: params.page,
|
||||
perPage: params.perPage,
|
||||
additionalFilters: params.additionalFilters,
|
||||
}
|
||||
)
|
||||
return `${PITCHBOOK_API_BASE}/people/search${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to search people')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stats: mapStats(data.stats),
|
||||
items: data.items ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stats: {
|
||||
type: 'object',
|
||||
description: 'Paging envelope for the result set',
|
||||
properties: {
|
||||
total: { type: 'number', description: 'Total number of matching results' },
|
||||
perPage: { type: 'number', description: 'Results returned per page' },
|
||||
page: { type: 'number', description: 'Current page number' },
|
||||
lastPage: { type: 'number', description: 'Number of the last available page' },
|
||||
},
|
||||
},
|
||||
items: {
|
||||
type: 'array',
|
||||
description: 'People matching the search criteria',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
personId: { type: 'string', description: 'PitchBook person ID' },
|
||||
personName: { type: 'string', description: 'Full name of the person' },
|
||||
firmId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the firm the person is associated with',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookPersonBioTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_person_bio',
|
||||
name: 'PitchBook Person Bio',
|
||||
description:
|
||||
'Retrieve the profile of a person: name, biography, LinkedIn, primary employer, position, and office',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook person ID, e.g. 53503-66P. Person IDs end in P and come from a people search.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/people/${params.pbId.trim()}/bio`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch person bio')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
personId: data.personId ?? null,
|
||||
personName: data.personName ?? null,
|
||||
biography: data.biography ?? null,
|
||||
linkedInProfileUrl: data.linkedInProfileUrl ?? null,
|
||||
gender: data.gender ?? null,
|
||||
primaryEntityId: data.primaryEntityId ?? null,
|
||||
primaryEntityName: data.primaryEntityName ?? null,
|
||||
primaryEntityType: data.primaryEntityType ?? null,
|
||||
primaryEntityWebsite: data.primaryEntityWebsite ?? null,
|
||||
primaryPosition: data.primaryPosition ?? null,
|
||||
primaryOffice: data.primaryOffice ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
personId: { type: 'string', description: 'PitchBook person ID', nullable: true },
|
||||
personName: {
|
||||
type: 'object',
|
||||
description: 'Parsed name of the person',
|
||||
properties: {
|
||||
full: { type: 'string', description: 'Full name', nullable: true },
|
||||
first: { type: 'string', description: 'First name', nullable: true },
|
||||
last: { type: 'string', description: 'Last name', nullable: true },
|
||||
middle: { type: 'string', description: 'Middle name', nullable: true },
|
||||
prefix: { type: 'string', description: 'Name prefix', nullable: true },
|
||||
suffix: { type: 'string', description: 'Name suffix', nullable: true },
|
||||
},
|
||||
},
|
||||
biography: { type: 'string', description: 'Biography of the person', nullable: true },
|
||||
linkedInProfileUrl: { type: 'string', description: 'LinkedIn profile URL', nullable: true },
|
||||
gender: { type: 'string', description: 'Gender recorded for the person', nullable: true },
|
||||
primaryEntityId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the primary employer',
|
||||
nullable: true,
|
||||
},
|
||||
primaryEntityName: {
|
||||
type: 'string',
|
||||
description: 'Name of the primary employer',
|
||||
nullable: true,
|
||||
},
|
||||
primaryEntityType: {
|
||||
type: 'string',
|
||||
description: 'Type of the primary employer, such as COMPANY or INVESTOR',
|
||||
nullable: true,
|
||||
},
|
||||
primaryEntityWebsite: {
|
||||
type: 'string',
|
||||
description: 'Website of the primary employer',
|
||||
nullable: true,
|
||||
},
|
||||
primaryPosition: {
|
||||
type: 'string',
|
||||
description: 'Position the person holds at the primary employer',
|
||||
nullable: true,
|
||||
},
|
||||
primaryOffice: {
|
||||
type: 'object',
|
||||
description: 'Office the person works out of',
|
||||
nullable: true,
|
||||
properties: {
|
||||
location: { type: 'string', description: 'Office label', nullable: true },
|
||||
addressLine1: { type: 'string', description: 'Address line 1', nullable: true },
|
||||
addressLine2: { type: 'string', description: 'Address line 2', nullable: true },
|
||||
city: { type: 'string', description: 'City', nullable: true },
|
||||
stateProvince: { type: 'string', description: 'State or province', nullable: true },
|
||||
postCode: { type: 'string', description: 'Postal code', nullable: true },
|
||||
country: { type: 'string', description: 'Country', nullable: true },
|
||||
phone: { type: 'string', description: 'Phone number', nullable: true },
|
||||
fax: { type: 'string', description: 'Fax number', nullable: true },
|
||||
email: { type: 'string', description: 'Email address', nullable: true },
|
||||
globalRegion: { type: 'string', description: 'Global region', nullable: true },
|
||||
globalSubRegion: { type: 'string', description: 'Global sub-region', nullable: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookPersonContactTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> = {
|
||||
id: 'pitchbook_person_contact',
|
||||
name: 'PitchBook Person Contact',
|
||||
description: 'Retrieve the direct contact details on file for a person',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook person ID, e.g. 53503-66P. Person IDs end in P and come from a people search.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/people/${params.pbId.trim()}/contact`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch person contact')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
personId: data.personId ?? null,
|
||||
fullName: data.fullName ?? null,
|
||||
phone: data.phone ?? null,
|
||||
fax: data.fax ?? null,
|
||||
email: data.email ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
personId: { type: 'string', description: 'PitchBook person ID', nullable: true },
|
||||
fullName: { type: 'string', description: 'Full name of the person', nullable: true },
|
||||
phone: { type: 'string', description: 'Phone number', nullable: true },
|
||||
fax: { type: 'string', description: 'Fax number', nullable: true },
|
||||
email: { type: 'string', description: 'Email address', nullable: true },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookPersonEducationWorkTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_person_education_work',
|
||||
name: 'PitchBook Person Education and Work',
|
||||
description:
|
||||
'Retrieve a person full history: education, company roles, board seats, deal roles, and fund roles',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook person ID, e.g. 53503-66P. Person IDs end in P and come from a people search.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/people/${params.pbId.trim()}/education-work`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch person education and work history')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
personId: data.personId ?? null,
|
||||
fullName: data.fullName ?? null,
|
||||
education: data.education ?? [],
|
||||
companyRoles: data.companyRoles ?? [],
|
||||
boardSeats: data.boardSeats ?? [],
|
||||
currentAdvisoryRoles: data.currentAdvisoryRoles ?? [],
|
||||
dealRoles: data.dealRoles ?? [],
|
||||
fundRoles: data.fundRoles ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
personId: { type: 'string', description: 'PitchBook person ID', nullable: true },
|
||||
fullName: { type: 'string', description: 'Full name of the person', nullable: true },
|
||||
education: {
|
||||
type: 'array',
|
||||
description: 'Institutions the person attended',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
institution: { type: 'string', description: 'Institution name' },
|
||||
degree: { type: 'string', description: 'Degree earned', nullable: true },
|
||||
yearOfGraduation: { type: 'number', description: 'Graduation year', nullable: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
companyRoles: {
|
||||
type: 'array',
|
||||
description: 'Positions the person has held at companies',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
companyId: { type: 'string', description: 'PitchBook company ID' },
|
||||
companyName: { type: 'string', description: 'Company name' },
|
||||
position: { type: 'string', description: 'Position title', nullable: true },
|
||||
positionType: {
|
||||
type: 'string',
|
||||
description: 'Whether the role is an employee or non-employee position',
|
||||
nullable: true,
|
||||
},
|
||||
positionStatus: {
|
||||
type: 'string',
|
||||
description: 'Whether the position is Current or Former',
|
||||
nullable: true,
|
||||
},
|
||||
positionStart: {
|
||||
type: 'string',
|
||||
description: 'Date the position started (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
positionFinish: {
|
||||
type: 'string',
|
||||
description: 'Date the position ended (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
boardSeats: {
|
||||
type: 'array',
|
||||
description: 'Board seats the person has held',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
boardCompanyId: { type: 'string', description: 'PitchBook ID of the company' },
|
||||
boardCompanyName: { type: 'string', description: 'Name of the company' },
|
||||
boardRepresentingId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the firm the seat represents',
|
||||
nullable: true,
|
||||
},
|
||||
boardRepresentingName: {
|
||||
type: 'string',
|
||||
description: 'Name of the firm the seat represents',
|
||||
nullable: true,
|
||||
},
|
||||
positionStatus: {
|
||||
type: 'string',
|
||||
description: 'Whether the seat is Current or Former',
|
||||
nullable: true,
|
||||
},
|
||||
boardStart: {
|
||||
type: 'string',
|
||||
description: 'Date the seat started (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
boardFinish: {
|
||||
type: 'string',
|
||||
description: 'Date the seat ended (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
currentAdvisoryRoles: {
|
||||
type: 'array',
|
||||
description: 'Advisory roles the person currently holds',
|
||||
items: { type: 'object' },
|
||||
},
|
||||
dealRoles: {
|
||||
type: 'array',
|
||||
description: 'Deals the person worked on and who they represented',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
dealId: { type: 'string', description: 'PitchBook deal ID' },
|
||||
dealDate: {
|
||||
type: 'string',
|
||||
description: 'Date of the deal (YYYY-MM-DD)',
|
||||
nullable: true,
|
||||
},
|
||||
companyId: { type: 'string', description: 'PitchBook ID of the company in the deal' },
|
||||
companyName: { type: 'string', description: 'Name of the company in the deal' },
|
||||
representingId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the firm the person represented',
|
||||
nullable: true,
|
||||
},
|
||||
representingName: {
|
||||
type: 'string',
|
||||
description: 'Name of the firm the person represented',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
fundRoles: {
|
||||
type: 'array',
|
||||
description: 'Funds the person is associated with',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
fundId: { type: 'string', description: 'PitchBook fund ID' },
|
||||
fundName: { type: 'string', description: 'Fund name' },
|
||||
investorId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the fund manager',
|
||||
nullable: true,
|
||||
},
|
||||
investorName: { type: 'string', description: 'Name of the fund manager', nullable: true },
|
||||
representingId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the firm the person represented',
|
||||
nullable: true,
|
||||
},
|
||||
representingName: {
|
||||
type: 'string',
|
||||
description: 'Name of the firm the person represented',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,389 @@
|
||||
/**
|
||||
* @vitest-environment node
|
||||
*/
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
|
||||
vi.unmock('@/tools/registry')
|
||||
|
||||
import { PitchBookBlock } from '@/blocks/blocks/pitchbook'
|
||||
import RECORDED from '@/tools/pitchbook/__fixtures__/recorded-responses.json'
|
||||
import { tools } from '@/tools/registry'
|
||||
|
||||
/**
|
||||
* The registry is typed `Record<string, ToolConfig>`, so a tool's `url`/`headers`/
|
||||
* `body` builders widen to their union. These narrow one back to a callable and
|
||||
* accept the caller's param object, keeping the assertions type-checked without
|
||||
* an `any` cast at every call site.
|
||||
*/
|
||||
type ToolParams = Record<string, unknown>
|
||||
|
||||
function urlBuilder(toolId: string): (params: ToolParams) => string {
|
||||
const url = tools[toolId].request.url
|
||||
if (typeof url !== 'function') throw new Error(`${toolId} has a static url`)
|
||||
return url as (params: ToolParams) => string
|
||||
}
|
||||
|
||||
function headerBuilder(toolId: string): (params: ToolParams) => Record<string, string> {
|
||||
const headers = tools[toolId].request.headers
|
||||
if (typeof headers !== 'function') throw new Error(`${toolId} has no header builder`)
|
||||
return headers as (params: ToolParams) => Record<string, string>
|
||||
}
|
||||
|
||||
function bodyBuilder(toolId: string): (params: ToolParams) => unknown {
|
||||
const body = tools[toolId].request.body
|
||||
if (typeof body !== 'function') throw new Error(`${toolId} has no body builder`)
|
||||
return body as (params: ToolParams) => unknown
|
||||
}
|
||||
|
||||
function blockParams(input: ToolParams): Record<string, unknown> {
|
||||
const build = PitchBookBlock.tools.config?.params
|
||||
if (!build) throw new Error('PitchBook block declares no params mapper')
|
||||
return build(input) as Record<string, unknown>
|
||||
}
|
||||
|
||||
describe('pitchbook wiring', () => {
|
||||
const access = PitchBookBlock.tools.access ?? []
|
||||
|
||||
it('registry keys match each tool id', () => {
|
||||
for (const id of access) {
|
||||
expect(tools[id], `missing registry entry ${id}`).toBeDefined()
|
||||
expect(tools[id].id).toBe(id)
|
||||
}
|
||||
})
|
||||
|
||||
it('every operation option maps to an accessible tool', () => {
|
||||
const op = PitchBookBlock.subBlocks.find((s) => s.id === 'operation')
|
||||
const ids = (op?.options as Array<{ id: string }>).map((o) => o.id)
|
||||
expect(ids.length).toBe(access.length)
|
||||
for (const id of ids) {
|
||||
const selected = PitchBookBlock.tools.config?.tool?.({ operation: id })
|
||||
expect(access).toContain(selected)
|
||||
}
|
||||
})
|
||||
|
||||
it('subblock ids are unique', () => {
|
||||
const ids = PitchBookBlock.subBlocks.map((s) => s.id)
|
||||
expect(new Set(ids).size).toBe(ids.length)
|
||||
})
|
||||
|
||||
it('maps prefixed search subblocks onto PitchBook query params', () => {
|
||||
const mapped = blockParams({
|
||||
operation: 'company_search',
|
||||
apiKey: 'k',
|
||||
coNames: 'Databricks',
|
||||
coCountry: 'USA',
|
||||
coDealDate: '>2023-01-01',
|
||||
page: '2',
|
||||
perPage: '50',
|
||||
additionalFilters: '{"locationType":"HQ_ONLY"}',
|
||||
})
|
||||
|
||||
expect(mapped.companyNames).toBe('Databricks')
|
||||
expect(mapped.country).toBe('USA')
|
||||
expect(mapped.dealDate).toBe('>2023-01-01')
|
||||
expect(mapped.coNames).toBeUndefined()
|
||||
expect(mapped.page).toBe(2)
|
||||
expect(mapped.perPage).toBe(50)
|
||||
expect(mapped.additionalFilters).toEqual({ locationType: 'HQ_ONLY' })
|
||||
})
|
||||
|
||||
it('collapses the entity-specific id subblock onto pbId', () => {
|
||||
const mapped = blockParams({
|
||||
operation: 'company_bio',
|
||||
apiKey: 'k',
|
||||
companyId: '10618-03',
|
||||
})
|
||||
expect(mapped.pbId).toBe('10618-03')
|
||||
expect(mapped.companyId).toBeUndefined()
|
||||
})
|
||||
|
||||
it('builds a company search URL with filters, paging, and extras', () => {
|
||||
const url = urlBuilder('pitchbook_company_search')
|
||||
const built = url({
|
||||
apiKey: 'k',
|
||||
companyNames: 'Databricks',
|
||||
dealDate: '>2023-01-01',
|
||||
country: '',
|
||||
page: 2,
|
||||
perPage: 50,
|
||||
additionalFilters: { locationType: 'HQ_ONLY' },
|
||||
})
|
||||
expect(built).toContain('https://api.pitchbook.com/companies/search?')
|
||||
expect(built).toContain('companyNames=Databricks')
|
||||
expect(built).toContain('dealDate=%3E2023-01-01')
|
||||
expect(built).toContain('locationType=HQ_ONLY')
|
||||
expect(built).toContain('page=2')
|
||||
expect(built).toContain('perPage=50')
|
||||
expect(built).not.toContain('country=')
|
||||
})
|
||||
|
||||
it('sends the PB-Token auth header and X-Currency only when set', () => {
|
||||
const headers = headerBuilder('pitchbook_company_bio')
|
||||
expect(headers({ apiKey: 'abc' }).Authorization).toBe('PB-Token abc')
|
||||
expect(headers({ apiKey: 'abc' })['X-Currency']).toBeUndefined()
|
||||
expect(headers({ apiKey: 'abc', currency: 'JPY' })['X-Currency']).toBe('JPY')
|
||||
})
|
||||
|
||||
it('never echoes the API key back in an unauthorized error', async () => {
|
||||
const transform = tools.pitchbook_company_bio.transformResponse!
|
||||
const res = new Response(
|
||||
JSON.stringify({ reason: 'UNAUTHORIZED', message: 'Active API key sk-secret-123 not found' }),
|
||||
{ status: 401 }
|
||||
)
|
||||
await expect(transform(res)).rejects.toThrow(/rejected the API key/)
|
||||
const res2 = new Response(
|
||||
JSON.stringify({ reason: 'UNAUTHORIZED', message: 'Active API key sk-secret-123 not found' }),
|
||||
{ status: 401 }
|
||||
)
|
||||
await expect(transform(res2)).rejects.not.toThrow(/sk-secret-123/)
|
||||
})
|
||||
|
||||
it('surfaces a non-auth PitchBook error message', async () => {
|
||||
const transform = tools.pitchbook_company_bio.transformResponse!
|
||||
const res = new Response(JSON.stringify({ reason: 'NOT_FOUND', message: 'No company found' }), {
|
||||
status: 404,
|
||||
})
|
||||
await expect(transform(res)).rejects.toThrow('No company found (NOT_FOUND)')
|
||||
})
|
||||
|
||||
it('renames the per-operation filter subblocks onto their API param names', () => {
|
||||
const mapped = blockParams({
|
||||
operation: 'patent_search',
|
||||
apiKey: 'k',
|
||||
companyId: '10618-03',
|
||||
patentStatus: 'Active',
|
||||
patentCpcSectionCode: 'G',
|
||||
patentFilingAuthority: 'EP',
|
||||
})
|
||||
expect(mapped.pbId).toBe('10618-03')
|
||||
expect(mapped.status).toBe('Active')
|
||||
expect(mapped.cpcSectionCode).toBe('G')
|
||||
expect(mapped.filingAuthorityLocation).toBe('EP')
|
||||
expect(mapped.patentStatus).toBeUndefined()
|
||||
})
|
||||
|
||||
it('parses the bulk article id list and posts it as PitchBook expects', async () => {
|
||||
const mapped = blockParams({
|
||||
operation: 'credit_news_bulk',
|
||||
apiKey: 'k',
|
||||
articleIds: '[11041384, 2142401]',
|
||||
})
|
||||
expect(mapped.articleIds).toEqual([11041384, 2142401])
|
||||
|
||||
const body = bodyBuilder('pitchbook_credit_news_bulk')
|
||||
expect(body({ apiKey: 'k', articleIds: [11041384, 2142401] })).toEqual({
|
||||
items: [{ articleId: 11041384 }, { articleId: 2142401 }],
|
||||
})
|
||||
})
|
||||
|
||||
it('builds the updates URL from whichever window field is set', () => {
|
||||
const url = urlBuilder('pitchbook_company_updates')
|
||||
expect(url({ apiKey: 'k', pbId: '1-1', sinceDate: '>2024-03-01' })).toContain(
|
||||
'sinceDate=%3E2024-03-01'
|
||||
)
|
||||
expect(url({ apiKey: 'k', pbId: '1-1', trailingRange: 10 })).toContain('trailingRange=10')
|
||||
expect(url({ apiKey: 'k', pbId: '1-1' })).toBe(
|
||||
'https://api.pitchbook.com/companies/1-1/updates'
|
||||
)
|
||||
})
|
||||
|
||||
it('puts the shared-search entity type in the path, not the query', () => {
|
||||
const url = urlBuilder('pitchbook_shared_search')
|
||||
const built = url({ apiKey: 'k', entityType: 'COMPANIES', searchId: 'abc', hash: 'def' })
|
||||
expect(built).toBe('https://api.pitchbook.com/COMPANIES/search?searchId=abc&hash=def')
|
||||
})
|
||||
|
||||
it('trims identifiers before putting them in the path or query', () => {
|
||||
const bio = urlBuilder('pitchbook_company_bio')
|
||||
expect(bio({ apiKey: 'k', pbId: ' 10618-03\n' })).toBe(
|
||||
'https://api.pitchbook.com/companies/10618-03/bio'
|
||||
)
|
||||
|
||||
const cash = urlBuilder('pitchbook_fund_cash_flows')
|
||||
expect(cash({ apiKey: 'k', pbId: ' 11373-13F ', period: ' 4Q2018 ' })).toBe(
|
||||
'https://api.pitchbook.com/funds/11373-13F/cashflows/4Q2018'
|
||||
)
|
||||
|
||||
const shared = urlBuilder('pitchbook_shared_search')
|
||||
expect(
|
||||
shared({ apiKey: 'k', entityType: ' COMPANIES ', searchId: ' abc ', hash: ' def ' })
|
||||
).toBe('https://api.pitchbook.com/COMPANIES/search?searchId=abc&hash=def')
|
||||
})
|
||||
|
||||
it('omits activeContract unless the user picks a side, since PitchBook is tri-state', () => {
|
||||
const cfg = PitchBookBlock.tools.config
|
||||
const run = (contractFilter?: string) =>
|
||||
blockParams({ operation: 'contracts_history', apiKey: 'k', contractFilter })
|
||||
|
||||
expect(run('all').activeContract).toBeUndefined()
|
||||
expect(run(undefined).activeContract).toBeUndefined()
|
||||
expect(run('active').activeContract).toBe(true)
|
||||
expect(run('past').activeContract).toBe(false)
|
||||
|
||||
const url = urlBuilder('pitchbook_contracts_history')
|
||||
expect(url({ apiKey: 'k' })).toBe('https://api.pitchbook.com/contracts/history')
|
||||
expect(url({ apiKey: 'k', activeContract: true })).toContain('activeContract=true')
|
||||
expect(url({ apiKey: 'k', activeContract: false })).toContain('activeContract=false')
|
||||
})
|
||||
|
||||
it('maps every recorded PitchBook response without dropping or inventing keys', async () => {
|
||||
let checked = 0
|
||||
for (const [toolId, body] of Object.entries(RECORDED) as Array<[string, unknown]>) {
|
||||
const tool = tools[toolId]
|
||||
expect(tool, `no tool registered for ${toolId}`).toBeDefined()
|
||||
const result = await tool.transformResponse!(
|
||||
new Response(JSON.stringify(body), { status: 200 })
|
||||
)
|
||||
expect(result.success, `${toolId} did not succeed`).toBe(true)
|
||||
|
||||
const declared = Object.keys(tool.outputs ?? {}).sort()
|
||||
const produced = Object.keys(result.output).sort()
|
||||
expect(produced, `${toolId} output keys drifted from its declared outputs`).toEqual(declared)
|
||||
|
||||
for (const [key, value] of Object.entries(result.output)) {
|
||||
expect(value, `${toolId}.${key} is undefined`).not.toBeUndefined()
|
||||
const declaredType = tool.outputs?.[key]?.type
|
||||
if (declaredType === 'array') {
|
||||
expect(Array.isArray(value), `${toolId}.${key} declared array but is not`).toBe(true)
|
||||
}
|
||||
}
|
||||
checked++
|
||||
}
|
||||
expect(checked).toBe(Object.keys(RECORDED).length)
|
||||
})
|
||||
|
||||
it('renames a filter only for the operation that owns it, so stale advanced values cannot leak', () => {
|
||||
// coCountry belongs to company_search; dealCountry to deal_search. The
|
||||
// serializer emits both when both hold values, whatever operation is active.
|
||||
const asCompany = blockParams({
|
||||
operation: 'company_search',
|
||||
apiKey: 'k',
|
||||
coCountry: 'USA',
|
||||
dealCountry: 'FRA',
|
||||
})
|
||||
expect(asCompany.country).toBe('USA')
|
||||
|
||||
const asDeal = blockParams({
|
||||
operation: 'deal_search',
|
||||
apiKey: 'k',
|
||||
coCountry: 'USA',
|
||||
dealCountry: 'FRA',
|
||||
})
|
||||
expect(asDeal.country).toBe('FRA')
|
||||
|
||||
// A filter owned by neither operation is cleared, not passed through.
|
||||
const asPeople = blockParams({
|
||||
operation: 'people_search',
|
||||
apiKey: 'k',
|
||||
coCountry: 'USA',
|
||||
dealCountry: 'FRA',
|
||||
})
|
||||
expect(asPeople.country).toBeUndefined()
|
||||
})
|
||||
|
||||
it('reads only the ID subblock its operation owns, so a stale ID cannot retarget the call', () => {
|
||||
// A leftover dealId must not hijack a company lookup — that would spend
|
||||
// credits fetching the wrong resource with no visible cue.
|
||||
const asCompany = blockParams({
|
||||
operation: 'company_bio',
|
||||
apiKey: 'k',
|
||||
companyId: '10618-03',
|
||||
dealId: '52721-65T',
|
||||
entityId: '51261-67',
|
||||
})
|
||||
expect(asCompany.pbId).toBe('10618-03')
|
||||
|
||||
const asDeal = blockParams({
|
||||
operation: 'deal_bio',
|
||||
apiKey: 'k',
|
||||
companyId: '10618-03',
|
||||
dealId: '52721-65T',
|
||||
})
|
||||
expect(asDeal.pbId).toBe('52721-65T')
|
||||
|
||||
// An operation that takes no entity ID must not inherit one.
|
||||
const asSearch = blockParams({
|
||||
operation: 'company_search',
|
||||
apiKey: 'k',
|
||||
companyId: '10618-03',
|
||||
dealId: '52721-65T',
|
||||
})
|
||||
expect(asSearch.pbId).toBeUndefined()
|
||||
})
|
||||
|
||||
it('exposes every window and paging field its operation actually accepts', () => {
|
||||
const visibleFor = (operation: string) =>
|
||||
new Set(
|
||||
PitchBookBlock.subBlocks
|
||||
.filter((sub) => {
|
||||
const condition = sub.condition
|
||||
if (!condition || condition.field !== 'operation') return true
|
||||
const values = Array.isArray(condition.value) ? condition.value : [condition.value]
|
||||
return values.includes(operation)
|
||||
})
|
||||
.map((sub) => sub.id)
|
||||
)
|
||||
|
||||
// Each tool declares these; the canvas must offer them too.
|
||||
expect(visibleFor('entity_news').has('sinceDate')).toBe(true)
|
||||
expect(visibleFor('shared_search').has('page')).toBe(true)
|
||||
expect(visibleFor('shared_search').has('perPage')).toBe(true)
|
||||
expect(visibleFor('company_social_analytics').has('compare')).toBe(true)
|
||||
})
|
||||
|
||||
it('clears cleared numeric fields instead of sending an empty string', () => {
|
||||
const mapped = blockParams({
|
||||
operation: 'company_search',
|
||||
apiKey: 'k',
|
||||
page: '',
|
||||
perPage: 'abc',
|
||||
trailingRange: '',
|
||||
})
|
||||
expect(mapped.page).toBeUndefined()
|
||||
expect(mapped.perPage).toBeUndefined()
|
||||
expect(mapped.trailingRange).toBeUndefined()
|
||||
|
||||
const url = urlBuilder('pitchbook_company_search')
|
||||
expect(url({ apiKey: 'k', page: undefined, perPage: undefined })).not.toContain('page=')
|
||||
})
|
||||
|
||||
it('parses additionalFilters even when a model passes it as a JSON string', () => {
|
||||
const url = urlBuilder('pitchbook_company_search')
|
||||
const built = url({ apiKey: 'k', additionalFilters: '{"locationType":"HQ_ONLY"}' })
|
||||
expect(built).toContain('locationType=HQ_ONLY')
|
||||
expect(built).not.toContain('0=%7B')
|
||||
})
|
||||
|
||||
it('sends a Content-Type on the one POST endpoint', () => {
|
||||
const headers = headerBuilder('pitchbook_credit_news_bulk')
|
||||
expect(headers({ apiKey: 'k' })['Content-Type']).toBe('application/json')
|
||||
})
|
||||
|
||||
it('returns the sandbox list for any entity type, not just companies', async () => {
|
||||
const transform = tools.pitchbook_sandbox_entities.transformResponse!
|
||||
const investors = await transform(
|
||||
new Response(
|
||||
JSON.stringify({
|
||||
entityTypeCounts: { investors: 2 },
|
||||
investors: [{ investorId: '1-1', investorName: 'A' }],
|
||||
}),
|
||||
{ status: 200 }
|
||||
)
|
||||
)
|
||||
expect(investors.output.entities).toEqual([{ investorId: '1-1', investorName: 'A' }])
|
||||
})
|
||||
|
||||
it('normalizes an array-root response and a missing nested field', async () => {
|
||||
const deals = await tools.pitchbook_company_deals.transformResponse!(
|
||||
new Response(JSON.stringify([{ dealId: '1-T' }]), { status: 200 })
|
||||
)
|
||||
expect(deals.output.deals).toEqual([{ dealId: '1-T' }])
|
||||
|
||||
const bio = await tools.pitchbook_company_bio.transformResponse!(
|
||||
new Response(JSON.stringify({ companyId: '10618-03' }), { status: 200 })
|
||||
)
|
||||
expect(bio.output.companyId).toBe('10618-03')
|
||||
expect(bio.output.website).toBeNull()
|
||||
expect(bio.output.universe).toEqual([])
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,103 @@
|
||||
import type { PitchbookResponse, PitchbookSandboxEntitiesParams } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
/**
|
||||
* PitchBook returns the sandbox list under a key named after the requested
|
||||
* entity type (`companies` for COMPANIES, and so on for the other six types).
|
||||
* Only the COMPANIES shape is recorded in the published docs, so rather than
|
||||
* guessing the other six key names this picks whichever array the payload
|
||||
* carries alongside the `entityTypeCounts` summary.
|
||||
*/
|
||||
function pickEntityList(data: Record<string, unknown>): unknown[] {
|
||||
for (const [key, value] of Object.entries(data)) {
|
||||
if (key !== 'entityTypeCounts' && Array.isArray(value)) return value
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
export const pitchbookSandboxEntitiesTool: ToolConfig<
|
||||
PitchbookSandboxEntitiesParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_sandbox_entities',
|
||||
name: 'PitchBook Sandbox Entities',
|
||||
description:
|
||||
'List the entities a sandbox API key is allowed to query, so test workflows have real IDs to run against',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
entityType: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Entity type to list: COMPANIES, INVESTORS, LIMITED_PARTNERS, SERVICE_PROVIDERS, PEOPLE, DEALS, or FUNDS. The matching array on the response is named after it, so COMPANIES returns a companies array.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
qs.set('entityType', params.entityType.trim())
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/sandbox-entities${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch sandbox entities')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
entityTypeCounts: data.entityTypeCounts ?? null,
|
||||
entities: pickEntityList(data),
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
entities: {
|
||||
type: 'array',
|
||||
description:
|
||||
'Entities the sandbox key may query. PitchBook names this array after the requested entity type, so it is surfaced under a stable `entities` key rather than the type-specific one.',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
companyId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook ID of the entity, keyed by its own entity type',
|
||||
optional: true,
|
||||
},
|
||||
companyName: {
|
||||
type: 'string',
|
||||
description: 'Name of the entity, keyed by its own entity type',
|
||||
optional: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
entityTypeCounts: {
|
||||
type: 'json',
|
||||
description: 'Count of available sandbox entities, keyed by entity type',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
import type { PitchbookGeneralSearchParams, PitchbookSearchResponse } from '@/tools/pitchbook/types'
|
||||
import {
|
||||
buildSearchQuery,
|
||||
mapStats,
|
||||
PITCHBOOK_API_BASE,
|
||||
pitchbookAuthHeaders,
|
||||
throwIfNotOk,
|
||||
} from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookSearchTool: ToolConfig<
|
||||
PitchbookGeneralSearchParams,
|
||||
PitchbookSearchResponse
|
||||
> = {
|
||||
id: 'pitchbook_search',
|
||||
name: 'PitchBook Search',
|
||||
description:
|
||||
'Search across every PitchBook entity type at once by name, PitchBook ID, website, or ticker. Use this to resolve a company, investor, or fund to its PitchBook ID before calling a profile operation.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
query: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'What to look up: an entity name, a PitchBook ID, a website, a ticker, or an exchange-qualified ticker. Names and websites match partially once the term is long enough; IDs and tickers match exactly.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
page: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Page of results to return, starting at 1',
|
||||
},
|
||||
perPage: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'How many results to return per page',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const query = buildSearchQuery(
|
||||
{ query: params.query },
|
||||
{ page: params.page, perPage: params.perPage }
|
||||
)
|
||||
return `${PITCHBOOK_API_BASE}/search?${query}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to run PitchBook search')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stats: mapStats(data.stats),
|
||||
items: data.items ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stats: {
|
||||
type: 'object',
|
||||
description: 'Paging envelope for the result set',
|
||||
properties: {
|
||||
total: { type: 'number', description: 'Total number of matching results' },
|
||||
perPage: { type: 'number', description: 'Results returned per page' },
|
||||
page: { type: 'number', description: 'Current page number' },
|
||||
lastPage: { type: 'number', description: 'Number of the last available page' },
|
||||
},
|
||||
},
|
||||
items: {
|
||||
type: 'array',
|
||||
description:
|
||||
'Matching entities. Entries carry pbId/name for companies, investors, and service providers, and fundId/fundName for funds, so check which is populated before using an ID.',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
pbId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook entity ID, null for fund results',
|
||||
nullable: true,
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Entity name, null for fund results',
|
||||
nullable: true,
|
||||
},
|
||||
fundId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook fund ID, present only on fund results',
|
||||
optional: true,
|
||||
nullable: true,
|
||||
},
|
||||
fundName: {
|
||||
type: 'string',
|
||||
description: 'Fund name, present only on fund results',
|
||||
optional: true,
|
||||
nullable: true,
|
||||
},
|
||||
website: {
|
||||
type: 'string',
|
||||
description: 'Entity website, absent on fund results',
|
||||
optional: true,
|
||||
nullable: true,
|
||||
},
|
||||
pitchBookProfileLink: {
|
||||
type: 'string',
|
||||
description: 'Link to the entity profile in the PitchBook platform',
|
||||
optional: true,
|
||||
nullable: true,
|
||||
},
|
||||
primaryFirmType: {
|
||||
type: 'object',
|
||||
description: 'Primary type of the entity',
|
||||
optional: true,
|
||||
nullable: true,
|
||||
properties: {
|
||||
pbId: { type: 'string', description: 'PitchBook entity ID' },
|
||||
type: { type: 'string', description: 'Entity type (e.g. COMPANY, INVESTOR)' },
|
||||
},
|
||||
},
|
||||
otherFirmTypes: {
|
||||
type: 'array',
|
||||
description: 'Additional types the entity is also classified as',
|
||||
optional: true,
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
pbId: { type: 'string', description: 'PitchBook entity ID' },
|
||||
type: { type: 'string', description: 'Entity type (e.g. COMPANY, INVESTOR)' },
|
||||
},
|
||||
},
|
||||
},
|
||||
stockTicker: {
|
||||
type: 'string',
|
||||
description: 'Stock ticker when the entity is publicly traded',
|
||||
optional: true,
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookServiceProviderBioTool: ToolConfig<
|
||||
PitchbookProfileParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_service_provider_bio',
|
||||
name: 'PitchBook Service Provider Bio',
|
||||
description:
|
||||
'Retrieve the profile of a service provider: names, types, description, and how many companies, deals, investors, funds, and limited partners it has serviced',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'PitchBook service provider ID, e.g. 11356-75. Use a service provider search to resolve a name to an ID.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `${PITCHBOOK_API_BASE}/service-providers/${params.pbId.trim()}/bio`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch service provider bio')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
serviceProviderId: data.serviceProviderId ?? null,
|
||||
serviceProviderName: data.serviceProviderName ?? null,
|
||||
description: data.description ?? null,
|
||||
website: data.website ?? null,
|
||||
employees: data.employees ?? null,
|
||||
servicedCompanies: data.servicedCompanies ?? null,
|
||||
servicedDeals: data.servicedDeals ?? null,
|
||||
servicedInvestors: data.servicedInvestors ?? null,
|
||||
servicedFunds: data.servicedFunds ?? null,
|
||||
servicedLimitedPartners: data.servicedLimitedPartners ?? null,
|
||||
serviceProviderTypes: data.serviceProviderTypes ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
serviceProviderId: {
|
||||
type: 'string',
|
||||
description: 'PitchBook service provider ID',
|
||||
nullable: true,
|
||||
},
|
||||
serviceProviderName: {
|
||||
type: 'object',
|
||||
description: 'The names the service provider is known by',
|
||||
properties: {
|
||||
formalName: { type: 'string', description: 'Formal name', nullable: true },
|
||||
alsoKnownAs: { type: 'string', description: 'Also-known-as name', nullable: true },
|
||||
legalName: { type: 'string', description: 'Registered legal name', nullable: true },
|
||||
formerlyKnownAs: { type: 'string', description: 'Previous name', nullable: true },
|
||||
},
|
||||
},
|
||||
serviceProviderTypes: {
|
||||
type: 'array',
|
||||
description: 'Types the service provider is classified as, one flagged primary',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
type: {
|
||||
type: 'object',
|
||||
description: 'Service provider type',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'Type code' },
|
||||
description: { type: 'string', description: 'Type label' },
|
||||
},
|
||||
},
|
||||
primary: { type: 'boolean', description: 'Whether this is the primary type' },
|
||||
},
|
||||
},
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'Description of the service provider',
|
||||
nullable: true,
|
||||
},
|
||||
website: { type: 'string', description: 'Service provider website', nullable: true },
|
||||
employees: { type: 'number', description: 'Employee count', nullable: true },
|
||||
servicedCompanies: {
|
||||
type: 'number',
|
||||
description: 'Number of companies serviced',
|
||||
nullable: true,
|
||||
},
|
||||
servicedDeals: { type: 'number', description: 'Number of deals serviced', nullable: true },
|
||||
servicedInvestors: {
|
||||
type: 'number',
|
||||
description: 'Number of investors serviced',
|
||||
nullable: true,
|
||||
},
|
||||
servicedFunds: { type: 'number', description: 'Number of funds serviced', nullable: true },
|
||||
servicedLimitedPartners: {
|
||||
type: 'number',
|
||||
description: 'Number of limited partners serviced',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
import type {
|
||||
PitchbookSearchResponse,
|
||||
PitchbookServiceProviderSearchParams,
|
||||
} from '@/tools/pitchbook/types'
|
||||
import {
|
||||
buildSearchQuery,
|
||||
mapStats,
|
||||
PITCHBOOK_API_BASE,
|
||||
pitchbookAuthHeaders,
|
||||
throwIfNotOk,
|
||||
} from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookServiceProviderSearchTool: ToolConfig<
|
||||
PitchbookServiceProviderSearchParams,
|
||||
PitchbookSearchResponse
|
||||
> = {
|
||||
id: 'pitchbook_service_provider_search',
|
||||
name: 'PitchBook Service Provider Search',
|
||||
description:
|
||||
'Search PitchBook for service providers by type, location, and the deals they have worked on',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
serviceProviderNames: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Comma-separated service provider names or PitchBook IDs',
|
||||
},
|
||||
serviceProviderType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook service provider type code',
|
||||
},
|
||||
city: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'City the service provider is located in',
|
||||
},
|
||||
stateProvince: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'State or province the service provider is located in',
|
||||
},
|
||||
country: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Country the service provider is located in (e.g. USA)',
|
||||
},
|
||||
locationType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Restrict location matching to HQ_ONLY, NON_HQ_ONLY, or ANY',
|
||||
},
|
||||
numberOfDeals: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of deals worked on. Use >50, <50, or 10^50 for a range',
|
||||
},
|
||||
dealType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook deal type code of the deals worked on',
|
||||
},
|
||||
dealDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Deal date filter. Use >YYYY-MM-DD, <YYYY-MM-DD, or YYYY-MM-DD^YYYY-MM-DD for a range',
|
||||
},
|
||||
dealSize: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Deal size in millions. Use >450, <450, or 10^450 for a range',
|
||||
},
|
||||
serviceTypesOnDeal: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Service type codes provided on the deal',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
page: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Page of results to return, starting at 1',
|
||||
},
|
||||
perPage: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'How many results to return per page',
|
||||
},
|
||||
additionalFilters: {
|
||||
type: 'json',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Any other documented search filter, as a JSON object of query parameter names to values (e.g. {"emergingSpaces": "AGTECH"}). A dedicated field always wins over the same key set here.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const query = buildSearchQuery(
|
||||
{
|
||||
serviceProviderNames: params.serviceProviderNames,
|
||||
serviceProviderType: params.serviceProviderType,
|
||||
city: params.city,
|
||||
stateProvince: params.stateProvince,
|
||||
country: params.country,
|
||||
locationType: params.locationType,
|
||||
numberOfDeals: params.numberOfDeals,
|
||||
dealType: params.dealType,
|
||||
dealDate: params.dealDate,
|
||||
dealSize: params.dealSize,
|
||||
serviceTypesOnDeal: params.serviceTypesOnDeal,
|
||||
},
|
||||
{
|
||||
page: params.page,
|
||||
perPage: params.perPage,
|
||||
additionalFilters: params.additionalFilters,
|
||||
}
|
||||
)
|
||||
return `${PITCHBOOK_API_BASE}/service-providers/search${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to search service providers')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
stats: mapStats(data.stats),
|
||||
items: data.items ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
stats: {
|
||||
type: 'object',
|
||||
description: 'Paging envelope for the result set',
|
||||
properties: {
|
||||
total: { type: 'number', description: 'Total number of matching results' },
|
||||
perPage: { type: 'number', description: 'Results returned per page' },
|
||||
page: { type: 'number', description: 'Current page number' },
|
||||
lastPage: { type: 'number', description: 'Number of the last available page' },
|
||||
},
|
||||
},
|
||||
items: {
|
||||
type: 'array',
|
||||
description: 'Service providers matching the search criteria',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
serviceProviderId: { type: 'string', description: 'PitchBook service provider ID' },
|
||||
serviceProviderName: { type: 'string', description: 'Service provider name' },
|
||||
website: { type: 'string', description: 'Service provider website', nullable: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
import type { PitchbookResponse, PitchbookUpdatesParams } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookServiceProviderUpdatesTool: ToolConfig<
|
||||
PitchbookUpdatesParams,
|
||||
PitchbookResponse
|
||||
> = {
|
||||
id: 'pitchbook_service_provider_updates',
|
||||
name: 'PitchBook Service Provider Updates',
|
||||
description:
|
||||
'Check which service provider datasets changed in a window, so a sync only refetches what moved',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook service provider ID, e.g. 11356-75.',
|
||||
},
|
||||
sinceDate: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Window to report changes over, carrying its operator in the value: >YYYY-MM-DD for after a date, <YYYY-MM-DD for before one, or YYYY-MM-DD^YYYY-MM-DD for a range. Use this or trailingRange.',
|
||||
},
|
||||
trailingRange: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Report changes over the last N days. Use this or sinceDate.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.sinceDate) qs.set('sinceDate', params.sinceDate)
|
||||
if (params.trailingRange !== undefined && params.trailingRange !== null) {
|
||||
qs.set('trailingRange', String(params.trailingRange))
|
||||
}
|
||||
const query = qs.toString()
|
||||
return `${PITCHBOOK_API_BASE}/service-providers/${params.pbId.trim()}/updates${query ? `?${query}` : ''}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch updates')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
updates: data.updates ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
updates: {
|
||||
type: 'json',
|
||||
description:
|
||||
'Map of dataset name to whether it changed in the window. Keys are PitchBook dataset names, so read it as a plain object.',
|
||||
nullable: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
import type { PitchbookProfileParams, PitchbookResponse } from '@/tools/pitchbook/types'
|
||||
import { PITCHBOOK_API_BASE, pitchbookAuthHeaders, throwIfNotOk } from '@/tools/pitchbook/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const pitchbookServicedCompaniesTool: ToolConfig<PitchbookProfileParams, PitchbookResponse> =
|
||||
{
|
||||
id: 'pitchbook_serviced_companies',
|
||||
name: 'PitchBook Serviced Companies',
|
||||
description: 'Retrieve the companies a service provider currently and formerly serves',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'PitchBook API key',
|
||||
},
|
||||
pbId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'PitchBook service provider ID, e.g. 11356-75.',
|
||||
},
|
||||
currency: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'ISO currency code to convert monetary values into, sent as the X-Currency header (e.g. USD, EUR, JPY). Defaults to the currency on the account preferences.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) =>
|
||||
`${PITCHBOOK_API_BASE}/service-providers/${params.pbId.trim()}/serviced-companies`,
|
||||
method: 'GET',
|
||||
headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
await throwIfNotOk(response, 'Failed to fetch serviced companies')
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
serviceProviderId: data.serviceProviderId ?? null,
|
||||
serviceProviderName: data.serviceProviderName ?? null,
|
||||
currentGeneralServices: data.currentGeneralServices ?? [],
|
||||
formerGeneralServices: data.formerGeneralServices ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
serviceProviderId: { type: 'string', description: 'PitchBook service provider ID' },
|
||||
serviceProviderName: { type: 'string', description: 'Service provider name' },
|
||||
currentGeneralServices: {
|
||||
type: 'array',
|
||||
description: 'Current general service relationships',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
entityId: { type: 'string', description: 'PitchBook entity ID' },
|
||||
entityName: { type: 'string', description: 'Entity name' },
|
||||
serviceProvided: {
|
||||
type: 'object',
|
||||
description: 'Service provided, as a code and description pair',
|
||||
properties: {
|
||||
code: { type: 'string', description: 'PitchBook code' },
|
||||
description: { type: 'string', description: 'Human-readable label for the code' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
formerGeneralServices: {
|
||||
type: 'array',
|
||||
description: 'Former general service relationships',
|
||||
items: { type: 'json' },
|
||||
},
|
||||
},
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user