naftiko: 1.0.0-alpha2 info: label: Pipedrive API v2 — Leads description: 'Pipedrive API v2 — Leads. 3 operations. Lead operation: Search leads. Self-contained Naftiko capability covering one Pipedrive business surface.' tags: - Pipedrive - Leads created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: PIPEDRIVE_API_KEY: PIPEDRIVE_API_KEY capability: consumes: - type: http namespace: v2-leads baseUri: https://api.pipedrive.com/api/v2 description: Pipedrive API v2 — Leads business capability. Self-contained, no shared references. resources: - name: leads-search path: /leads/search operations: - name: searchleads method: GET description: Search leads outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: term in: query type: string description: The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. required: true - name: fields in: query type: string description: A comma-separated string array. The fields to perform the search from. Defaults to all of them. - name: exact_match in: query type: boolean description: When enabled, only full exact matches against the given term are returned. It is not case sensitive. - name: person_id in: query type: integer description: Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. - name: organization_id in: query type: integer description: Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. - name: include_fields in: query type: string description: Supports including optional fields in the results which are not provided by default - name: limit in: query type: integer description: For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. - name: cursor in: query type: string description: For pagination, the marker (an opaque string value) representing the first item on the next page - name: leads-id-convert-deal path: /leads/{id}/convert/deal operations: - name: convertleadtodeal method: POST description: Convert a lead to a deal outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: The ID of the lead to convert required: true - name: body in: body type: object description: Request body (JSON). required: false - name: leads-id-convert-status-conversion_id path: /leads/{id}/convert/status/{conversion_id} operations: - name: getleadconversionstatus method: GET description: Get Lead conversion status outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: The ID of a lead required: true - name: conversion_id in: path type: string description: The ID of the conversion required: true authentication: type: bearer token: '{{env.PIPEDRIVE_API_KEY}}' exposes: - type: rest namespace: v2-leads-rest port: 8080 description: REST adapter for Pipedrive API v2 — Leads. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/leads/search name: leads-search description: REST surface for leads-search. operations: - method: GET name: searchleads description: Search leads call: v2-leads.searchleads with: term: rest.term fields: rest.fields exact_match: rest.exact_match person_id: rest.person_id organization_id: rest.organization_id include_fields: rest.include_fields limit: rest.limit cursor: rest.cursor outputParameters: - type: object mapping: $. - path: /v1/leads/{id}/convert/deal name: leads-id-convert-deal description: REST surface for leads-id-convert-deal. operations: - method: POST name: convertleadtodeal description: Convert a lead to a deal call: v2-leads.convertleadtodeal with: id: rest.id body: rest.body outputParameters: - type: object mapping: $. - path: /v1/leads/{id}/convert/status/{conversion-id} name: leads-id-convert-status-conversion-id description: REST surface for leads-id-convert-status-conversion_id. operations: - method: GET name: getleadconversionstatus description: Get Lead conversion status call: v2-leads.getleadconversionstatus with: id: rest.id conversion_id: rest.conversion_id outputParameters: - type: object mapping: $. - type: mcp namespace: v2-leads-mcp port: 9090 transport: http description: MCP adapter for Pipedrive API v2 — Leads. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: search-leads description: Search leads hints: readOnly: true destructive: false idempotent: true call: v2-leads.searchleads with: term: tools.term fields: tools.fields exact_match: tools.exact_match person_id: tools.person_id organization_id: tools.organization_id include_fields: tools.include_fields limit: tools.limit cursor: tools.cursor outputParameters: - type: object mapping: $. - name: convert-lead-deal description: Convert a lead to a deal hints: readOnly: false destructive: false idempotent: false call: v2-leads.convertleadtodeal with: id: tools.id body: tools.body outputParameters: - type: object mapping: $. - name: get-lead-conversion-status description: Get Lead conversion status hints: readOnly: true destructive: false idempotent: true call: v2-leads.getleadconversionstatus with: id: tools.id conversion_id: tools.conversion_id outputParameters: - type: object mapping: $.