Files
kamidso-back/kamidso/native_connectors/providers/didar/function_accuracy_patch.json
T
javadandCursor edbaa2acec Add native Didar connectors so chats can query CRM data reliably.
Connector calls, semantic rules, and DuckDB memory keep long runs stable, and stream retry stops chats from stalling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-12 19:26:47 +03:30

398 lines
11 KiB
JSON

{
"schema_version": "1.0",
"provider": "didar",
"purpose": "Merge these accuracy-critical contracts into the existing 49-function catalog. Do not replace correct existing definitions blindly.",
"patches": [
{
"name": "search_deals",
"method": "POST",
"path": "/api/deal/search_v2",
"effect": "read",
"input_schema": {
"type": "object",
"properties": {
"Criteria": {
"type": "object",
"properties": {
"SearchFromTime": {
"type": "string",
"format": "date-time"
},
"SearchToTime": {
"type": "string",
"format": "date-time"
},
"Sort": {
"type": "integer",
"minimum": 0,
"maximum": 10
},
"ContactIds": {
"type": "array",
"items": {
"type": "string"
}
},
"CompanyIds": {
"type": "array",
"items": {
"type": "string"
}
},
"OtherContactIds": {
"type": "array",
"items": {
"type": "string"
}
},
"Keywords": {
"type": "string"
},
"LabelIds": {
"type": "array",
"items": {
"type": "string"
}
},
"Status": {
"type": "string",
"enum": [
"Pending",
"Won",
"Lost"
]
},
"CustomFields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"CustomFieldId": {
"type": "string"
},
"OR": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Type": {
"type": "string",
"enum": [
"NotSet",
"Set",
"EqualToAny",
"NotEqualAny",
"ContainsAnyString",
"NotContainsAnyString",
"StartsWith",
"LessThan",
"GreaterThan",
"Between"
]
},
"Value": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"Type",
"Value"
],
"additionalProperties": false
}
}
},
"required": [
"CustomFieldId",
"OR"
],
"additionalProperties": false
}
},
"PipelineId": {
"type": "string"
},
"PipelineStageId": {
"type": "string"
},
"SourceId": {
"type": "string"
},
"IsDeleted": {
"type": "boolean"
},
"HasActivity": {
"type": "boolean"
},
"LostReasonId": {
"type": "string"
},
"NextActivityFrom": {
"type": "string",
"format": "date-time"
},
"NextActivityTo": {
"type": "string",
"format": "date-time"
},
"IsIdle": {
"type": "boolean"
},
"IsRotten": {
"type": "boolean"
},
"Probability": {
"type": "string"
},
"OwnerIds": {
"type": "array",
"items": {
"type": "string"
}
},
"PipelineStageIds": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"From": {
"type": "integer",
"minimum": 0
},
"Limit": {
"type": "integer",
"minimum": 1
}
},
"required": [
"Criteria",
"From",
"Limit"
],
"additionalProperties": false
},
"response_contract": {
"root": "Response",
"records_path": "Response.List",
"total_count": "Response.TotalCount",
"aggregates": [
"Response.TotalPrice",
"Response.AllDealsTotalPrice",
"Response.AllDealsCount",
"Response.PendingDealsTotalPrice",
"Response.PendingDealsCount",
"Response.WonDealsTotalPrice",
"Response.WonDealsCount",
"Response.LostDealsTotalPrice",
"Response.LostDealsCount"
]
},
"semantic_hints": [
"From and Limit are top-level fields, not inside Criteria.",
"Status accepts Pending, Won, Lost.",
"Sort=0 means registration time; Sort=9 means won time.",
"Use aggregate counts for totals; Response.List is only the current page.",
"Current status must come from each deal's Status field."
]
},
{
"name": "search_persons",
"method": "POST",
"path": "/api/contact/PersonSearch",
"effect": "read",
"input_schema": {
"type": "object",
"properties": {
"Criteria": {
"type": "object",
"properties": {
"IsDeleted": {
"type": "integer",
"enum": [
0,
1
]
},
"IsPinned": {
"type": "integer"
},
"IsVIP": {
"type": "integer"
},
"SortOrder": {
"type": "integer"
},
"Keywords": {
"type": [
"string",
"null"
]
},
"MobilePhone": {
"type": "string"
},
"WorkPhone": {
"type": "string"
},
"Email": {
"type": "string"
},
"NationalCode": {
"type": "string"
},
"ZipCode": {
"type": "string"
},
"CustomerCode": {
"type": "string"
},
"SearchFromTime": {
"type": "string",
"format": "date-time"
},
"SearchToTime": {
"type": "string",
"format": "date-time"
},
"CustomFields": {
"type": "array"
}
},
"additionalProperties": true
},
"From": {
"type": "integer",
"minimum": 0
},
"Limit": {
"type": "integer",
"minimum": 1
}
},
"required": [
"Criteria",
"From",
"Limit"
],
"additionalProperties": false
},
"response_contract": {
"root": "Response",
"records_path": "Response.List",
"total_count": "Response.TotalCount"
}
},
{
"name": "get_users",
"method": "POST",
"path": "/api/User/List",
"effect": "read",
"input_schema": {
"type": "object",
"properties": {},
"additionalProperties": false
},
"response_contract": {
"root": "Response",
"records_path": "Response",
"owner_key": "UserId",
"display_field": "DisplayName"
}
},
{
"name": "get_deal",
"method": "POST",
"path": "/api/deal/getdealdetail",
"effect": "read",
"input_schema": {
"type": "object",
"properties": {
"Id": {
"type": "string"
}
},
"required": [
"Id"
],
"additionalProperties": false
},
"semantic_hints": [
"Status is authoritative for current deal status.",
"Do not infer Won merely because ChangeToWonTime has a value; official response examples can contain ChangeToWonTime while Status is Pending."
]
},
{
"name": "get_deal_pipelines",
"method": "POST",
"path": "/api/pipeline/list/0",
"effect": "read",
"input_schema": {
"type": "object",
"properties": {},
"additionalProperties": false
},
"response_contract": {
"root": "Response",
"records_path": "Response",
"pipeline_id": "Response[].Id",
"stage_id": "Response[].Stages[].Id",
"stage_title": "Response[].Stages[].Title"
}
},
{
"name": "search_products",
"method": "POST",
"path": "/api/product/search",
"effect": "read",
"input_schema": {
"type": "object",
"properties": {
"Criteria": {
"type": "object",
"properties": {
"Keywords": {
"type": "string"
}
},
"required": [
"Keywords"
],
"additionalProperties": false
},
"From": {
"type": "integer",
"minimum": 0
},
"Limit": {
"type": "integer",
"minimum": 1
}
},
"required": [
"Criteria",
"From",
"Limit"
],
"additionalProperties": false
}
},
{
"name": "get_product_categories",
"method": "POST",
"path": "/api/product/categories",
"effect": "read",
"input_schema": {
"type": "object",
"properties": {},
"additionalProperties": false
}
}
]
}