Token导航 LogoToken导航TokenDH.com
MCP rfq processor logo
搜索检索stdio官方级别未说明来源级核验

MCP rfq processor

MCP Server

MCP RFQ处理器是一款用于处理报价请求(RFQ)操作的服务,为AI助手提供管理完整RFQ生命周期的工具。

工具数

29

提示词数

0

GitHub Stars

0

资源数

0
PythonClaude搜索Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

ideabosque

提供方

ideabosque

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -e .

详细介绍

MCP RFQ处理器

模型上下文协议(MCP)服务器,用于处理询价(RFQ)操作,为AI助手提供管理完整RFQ生命周期的工具。

概述

MCP RFQ处理器将AI助手连接到 ai_rfq_engine GraphQL后端,实现以下功能的智能自动化:

  • RFQ请求管理:通过灵活的项目管理提交、更新和跟踪客户报价请求
  • 商品和库存搜索:通过批量跟踪查找可用项目和供应商库存
  • 报价生成:通过灵活的项目操作、定价和折扣创建和管理详细的报价
  • 分期付款计划:为报价设置付款计划
  • 文档管理:上传和跟踪询价相关文件
  • 细分市场管理:将客户和供应商组织到定价细分市场

当前版本: 0.1.1 MCP工具总数28(已实施) mcp_configuration.py)

当前功能亮点

  • 状态感知工作流控制

- 请求、报价和分期付款通过护栏强制执行经过验证的转换 - 自动更新请求状态至 in_progress 当项目发生变化时 - 报价自动转换为 in_progress 创建项目时

  • 自动业务规则

- 标记请求时自动不批准报价 modified - 当所有分期付款都完成时,自动完成报价 paid,然后自动完成请求 - 当一个报价被确认时,竞争报价将被拒绝(除非已经终止)

  • 提供者分配助手

- assign_provider_item_to_request_itemremove_provider_item_from_request_item 根据请求管理提供者链接 - 报价创建提取分配的提供商项目以自动构建报价项目

  • 批量优化定价智能

- calculate_quote_pricing 使用基于电子邮件的批处理加载器按提供者高效地对请求项进行分组 - 单个GraphQL查询使用DataLoader模式检索所有商品的所有价格层 - get_item_price_tiers 支持使用email+quoteitems数组进行批量查询 - get_discount_prompts 有效地从所有层次范围加载折扣提示

  • 工作流程便利性

- confirm_request_and_create_quotesconfirm_quote_and_create_installments 包装多步骤流程以实现更快的自动化

开发_计划.md 获取完整的工作流文档。

建筑

高级体系结构

graph TB
    subgraph Clients
        AI["AI Assistant
Claude, etc."]
        Browser["Browser / Custom Client"]
    end

    subgraph MCP_Layer["MCP Layer"]
        MCPServer["MCP RFQ Processor
this package"]
        Processors["Layered Processors
Request | Item | Quote | Pricing | Installment"]
    end

    subgraph Backend_Layer["Backend Layer"]
        GraphQL["ai_rfq_engine
GraphQL API
AWS Lambda"]
        Batch["Batch Loaders
DataLoader Pattern"]
    end

    subgraph Data_Layer["Data Layer"]
        DDB[("DynamoDB
RFQ Tables")]
        S3[("S3
File Storage")]
    end

    AI -->|MCP Protocol| MCPServer
    Browser -->|MCP Protocol| MCPServer
    MCPServer --> Processors
    Processors -->|GraphQL Queries/Mutations| GraphQL
    GraphQL --> Batch
    Batch -->|Optimized Queries| DDB
    GraphQL -->|Store/Retrieve Files| S3

组件流程

AI Assistant (Claude, etc.)
    ↓ MCP Protocol (28 Tools)
MCP RFQ Processor (this package)
    ├── Request Processor (8 tools)
    ├── Item Processor (4 tools)
    ├── Quote Processor (5 tools)
    ├── Pricing Processor (3 tools)
    ├── Installment Processor (4 tools)
    ├── File Processor (2 tools)
    └── Segment Processor (1 tool)
    ↓ GraphQL over AWS Lambda
ai_rfq_engine (backend)
    ├── Batch Loaders (v0.1.1)
    ├── Status Managers
    └── Business Rules Engine
    ↓
DynamoDB Tables + S3 Storage

安装

先决条件

  • Python>=3.8
  • 具有Lambda执行权限的AWS凭据
  • 访问已部署 ai_rfq_engine GraphQL端点

从源代码安装

cd mcp_rfq_processor
pip install -e .

再进行

pip install boto3 humps pendulum silvaengine-utility

配置

MCP服务器配置

添加到您的MCP设置文件(例如。, claude_desktop_config.json):

{
  "mcpServers": {
    "rfq_processor": {
      "command": "python",
      "args": ["-m", "mcp_rfq_processor"],
      "env": {
        "ENDPOINT_ID": "your-endpoint-id",
        "AWS_REGION": "us-east-1",
        "AWS_ACCESS_KEY_ID": "your-access-key",
        "AWS_SECRET_ACCESS_KEY": "your-secret-key"
      }
    }
  }
}

模块设置

当用作Python模块时:

from mcp_rfq_processor import MCPRfqProcessor
import logging

logger = logging.getLogger(__name__)

processor = MCPRfqProcessor(
    logger=logger,
    region_name="us-east-1",
    aws_access_key_id="your-access-key",
    aws_secret_access_key="your-secret-key",
    execute_mode="aws_lambda",  # or "local" for testing
    default_batch_expiration_filter_days=90,  # Default: 90 days (~3 months)
    installment_scheduled_day=15,  # Default: 15th day of month for installment schedules
)

processor.endpoint_id = "your-endpoint-id"

配置选项:

设置类型默认值描述
region_namestring-部署Lambda函数的AWS区域
aws_access_key_idstring-AWS访问密钥ID
aws_secret_access_keystring-AWS秘密访问密钥
execute_modestring-执行模式: aws_lambdalocal
default_batch_expiration_filter_daysinteger90默认的最短过期天数 get_provider_item_batches。当没有提供过期过滤器时,只返回在未来几天或更长时间内过期的批次。
installment_scheduled_dayinteger15中计划分期付款日期的月份(1-31) create_installments。如果一个月中不存在日期(例如2月31日),则使用该月的最后一天。

可用的MCP工具

所有28个工具都在 mcp_configuration.py 并暴露于 MCPRfqProcessor.

工具组织

graph TB
    subgraph Request_Management[Request Management - 8 Tools]
        R1[submit_rfq_request]
        R2[update_rfq_request]
        R3[get_rfq_request]
        R4[search_rfq_requests]
        R5[add_item_to_rfq_request]
        R6[remove_item_from_rfq_request]
        R7[assign_provider_item_to_request_item]
        R8[remove_provider_item_from_request_item]
    end

    subgraph Item_Management[Item & Inventory - 4 Tools]
        I1[search_items]
        I2[get_item]
        I3[get_provider_items]
        I4[get_provider_item_batches]
    end

    subgraph Quote_Management[Quote Management - 5 Tools]
        Q1[create_quote]
        Q2[update_quote]
        Q3[get_quote]
        Q4[search_quotes]
        Q5[update_quote_item]
    end

    subgraph Pricing[Pricing & Discounts - 3 Tools]
        P1[get_item_price_tiers
Batch-Optimized]
        P2[get_discount_prompts
Hierarchical Scopes]
        P3[calculate_quote_pricing
Groups by Provider]
    end

    subgraph Installment[Installment Management - 4 Tools]
        IN1[create_installment]
        IN2[update_installment]
        IN3[create_installments]
        IN4[get_installments]
    end

    subgraph Workflow[Workflow Helpers - 2 Tools]
        W1[confirm_request_and_create_quotes]
        W2[confirm_quote_and_create_installments]
    end

    subgraph Files[File Management - 2 Tools]
        F1[upload_rfq_file]
        F2[get_rfq_files]
    end

    subgraph Segments[Segment Management - 1 Tool]
        S1[get_segment_contacts]
    end

    style Request_Management fill:#e1f5ff
    style Item_Management fill:#fff4e1
    style Quote_Management fill:#e1ffe1
    style Pricing fill:#ffe1f5
    style Installment fill:#f5e1ff
    style Workflow fill:#e1fff4
    style Files fill:#ffe1e1
    style Segments fill:#f5ffe1

1.请求管理(8个工具)

submit_rfq_request

提交客户的新RFQ请求。

默认状态: initial -请求已创建,但尚未处理。

输入:

{
  "email": "customer@example.com",
  "request_title": "Need 500 units of Product X",
  "request_description": "Detailed requirements...",
  "billing_address": {},
  "shipping_address": {},
  "items": [],
  "notes": "Urgent order",
  "expired_at": "2025-12-31T23:59:59Z",
  "status": "initial"
}

输出:

{
  "request_uuid": "generated-uuid",
  "status": "initial",
  "created_at": "2025-11-05T10:30:00Z",
  "items": []
}

update_rfq_request

更新现有的RFQ请求(标题、描述、地址、项目、状态等)。

状态转换:所有状态更改都根据请求状态流进行验证。

自动业务规则:

  • 当状态更改为 modified,所有相关报价都会自动设置为 disapproved
  • 当项目在 modified 状态,自动转换为 in_progress

输入:

{
  "request_uuid": "request-uuid-string",
  "request_title": "Updated title",
  "items": [...],
  "status": "confirmed"
}

输出: 已更新请求对象。

add_item_to_rfq_request

向现有请求添加单个项目的便利方法。

输入:

{
  "request_uuid": "request-uuid-string",
  "item": {
    "item_uuid": "item-uuid",
    "quantity": 100
  }
}

输出: 已更新请求,添加了新项目。

remove_item_from_rfq_request

从现有请求中删除单个项目的便利方法。

输入:

{
  "request_uuid": "request-uuid-string",
  "item_uuid": "item-uuid-to-remove"
}

输出: 已更新请求,删除了项目。

assign_provider_item_to_request_item

将提供者项目(和可选批次/数量)附加到请求项目。验证提供程序项是否属于指定的提供程序,并将状态更新为 in_progress 必要时。

remove_provider_item_from_request_item

从请求项中删除提供程序分配。可以针对特定的提供者项目/批次,也可以清除请求项目的所有提供者项目。

get_rfq_request

检索现有RFQ请求的详细信息。

输入:

{
  "request_uuid": "request-uuid-string"
}

输出: 使用联系信息和相关报价填写请求对象。

search_rfq_requests

搜索和过滤询价请求。

输入:

{
  "contact_uuid": "optional-contact-uuid",
  "statuses": ["pending", "quoted"],
  "from_expired_at": "2025-01-01T00:00:00Z",
  "to_expired_at": "2025-12-31T23:59:59Z",
  "page_number": 1,
  "limit": 20
}

输出: 匹配请求的分页列表。

______________________________________________________________________

2.物料和库存管理(4个工具)

search_items

在目录中搜索可用项目。

输入:

{
  "item_type": "product",
  "item_name": "Widget",
  "uoms": ["EA", "BOX"],
  "page_number": 1,
  "limit": 50
}

输出: 包含描述、类型和计量单位选项的项目列表。

get_item

获取特定项目的详细信息。

输入:

{
  "item_uuid": "item-uuid-string"
}

输出: 完整的商品详细信息,包括定价等级。

get_provider_items

使用合并的批次信息搜索提供程序清单。

对于每个提供者项目,自动获取并合并批处理信息,包括:

  • 批次:带有slow_move_item标志和护栏定价的批次详细信息数组
  • 每批包括:批次号、过期日期、生产日期、慢移动项目、保证金价格

可选批过滤器(在获取批时应用):

  • 过期at_gt:筛选在此日期之后过期的批次
  • 过期_at_lt:筛选在此日期之前过期的批次
  • 慢速移动项目:筛选流动缓慢的库存(默认值:false)
  • 库存中:筛选库存批次(默认值:true)

输入:

{
  "item_uuid": "optional-item-uuid",
  "provider_corp_external_id": "PROVIDER-001",
  "min_base_price_per_uom": 10.00,
  "max_base_price_per_uom": 50.00,
  "expired_at_gt": "2025-11-05T00:00:00Z",
  "slow_move_item": false,
  "in_stock": true,
  "page_number": 1,
  "limit": 50
}

输出: 包含定价、可用性和合并批信息的提供商项目列表。

注: 如果没有提供过期过滤器,则默认为从现在起90多天后过期的批次。

get_provider_item_batches

获取供应商项目的批次/批次信息,包括slow_move_item标志和护栏定价。

输入:

{
  "provider_item_uuid": "provider-item-uuid",
  "in_stock": true,
  "expired_at_gt": "2025-11-05T00:00:00Z"
}

输出: 带有批号、有效期和库存水平的批次列表。

注: 如果既没有提供expired_at_gt也没有提供expried_at_lt,则默认过滤90天后到期的批次。

______________________________________________________________________

3.报价管理(5个工具)

create_quote

为RFQ请求生成新报价。

默认状态: initial -报价已创建,但尚未处理。

需求:

  • 请求必须在 confirmed 创建报价的状态

备注:

  • shipping_methodshipping_amount 创建时无法设置-使用 update_quote 创作后
  • rounds (协商轮次)由后端自动计算
  • 报价项是根据所选提供商的请求从提供商分配中自动创建的

输入:

{
  "request_uuid": "request-uuid",
  "provider_corp_external_id": "PROVIDER-001",
  "sales_rep_email": "sales@provider.com",
  "status": "initial",
  "notes": "Initial quote"
}

输出:

{
  "quote_uuid": "generated-quote-uuid",
  "request_uuid": "request-uuid",
  "rounds": 0,
  "total_quote_amount": 0.00,
  "status": "initial"
}

get_quote

检索报价详细信息。

输入:

{
  "request_uuid": "request-uuid",
  "quote_uuid": "quote-uuid"
}

输出: 填写报价单,包括行项目、总计和折扣信息。

update_quote

更新报价元数据(发货、状态、备注)。

状态转换:所有状态更改都根据报价状态流进行验证。

备注: rounds (协商轮次)由后端自动计算,不能手动设置。

输入:

{
  "request_uuid": "request-uuid",
  "quote_uuid": "quote-uuid",
  "shipping_method": "express",
  "shipping_amount": 75.00,
  "status": "confirmed",
  "notes": "Updated pricing and shipping"
}

输出: 更新了自动计算的报价对象 rounds.

search_quotes

搜索和过滤报价。

输入:

{
  "request_uuid": "optional-request-uuid",
  "provider_corp_external_id": "PROVIDER-001",
  "statuses": ["confirmed", "completed"],
  "min_total_quote_amount": 1000.00,
  "page_number": 1,
  "limit": 20
}

输出: 匹配引号的分页列表。

update_quote_item

更新现有报价项目(仅折扣金额)。用于在创建报价项目后应用折扣。

需求:

  • 报价必须在 in_progress 申请折扣的状态
  • 只允许修改折扣(折扣金额调整)

备注:只有 discount_amount 可以更新。其他字段(qty、provider_item_uuid等)在创建后是只读的。

输入:

{
  "quote_uuid": "quote-uuid",
  "quote_item_uuid": "quote-item-uuid",
  "discount_amount": 75.00
}

输出: 更新了报价项目,并重新计算了总计。

______________________________________________________________________

4.定价和折扣(3个工具)

get_item_price_tiers

使用批处理加载器优化为多个项目获得分层定价。

批量优化方法:使用客户电子邮件进行细分查找,并通过自动数量过滤有效地加载报价项目的价格等级。仅返回与每个项目数量范围匹配的等级。更适合高效处理多个项目。

输入:

{
  "email": "customer@example.com",
  "quote_items": [
    {
      "item_uuid": "item-uuid",
      "provider_item_uuid": "provider-item-uuid",
      "qty": 100
    }
  ]
}

参数:

  • email:用于分段查找的客户电子邮件地址(必填)
  • quote_items:包含item_uid、provider_item_uid和数量的报价项目列表。每个项目都将根据数量阈值返回其适用的价格等级。

输出: 合并了provider_item_batches的价格层列表。

{
  "item_price_tiers": [
    {
      "item_uuid": "...",
      "provider_item_uuid": "...",
      "quantity_greater_then": 50,
      "quantity_less_then": 200,
      "price_per_uom": 10.5,
      "margin_per_uom": 2.0,
      "provider_item_batches": [
        {
          "batch_no": "LOT-2025-001",
          "price_per_uom": 10.0
        }
      ]
    }
  ]
}

更新于v0.1.1:重构为使用基于电子邮件的分段查找的批处理加载器,以获得更好的性能。

get_discount_prompts

使用批处理加载器优化获取商品的折扣提示。

批量优化方法:从所有层次范围(GLOBAL、SEGMENT、ITEM、PROVIDER_ITEM)加载提示并进行重复数据消除。返回带有条件和规则的组合折扣提示。更适合高效处理多个项目。

输入:

{
  "email": "customer@example.com",
  "quote_items": [
    {
      "item_uuid": "item-uuid",
      "provider_item_uuid": "provider-item-uuid"
    }
  ]
}

参数:

  • email:用于分段查找的客户电子邮件地址(必填)
  • quote_items:带有item_uid和provider_item_uid的报价项目列表,以确定适用的提示

输出: 来自所有层次范围的组合折扣提示。

{
  "discount_prompts": [
    {
      "scope": "SEGMENT",
      "prompt": "Apply 5% discount for slow-moving items",
      "conditions": "slow_move_item=true",
      "max_discount_percentage": 5.0
    }
  ]
}

v0.1.1中的新功能:替换 get_discount_rules 通过跨层次范围的批量优化提示加载。

calculate_quote_pricing

使用批量优化查询计算询价请求的定价信息。

批量优化方法:按供应商对项目进行分组,并提供小计和价格等级。使用批处理加载器进行高效的多项目处理。返回定价结构以供决策。

备注:这从REQUEST(不是引号)读取,并按provider_corp_external_id对项目进行分组。在创建引号之前使用此选项(工作流中的步骤7)。

输入:

{
  "request_uuid": "request-uuid",
  "email": "customer@example.com"
}

参数:

  • request_uuid:RFQ请求的UUID(必填)
  • email:用于细分查找和批量优化价格层查询的客户电子邮件(必填)

输出: 按供应商分组的项目分组定价结构。

{
  "request_uuid": "req-uuid",
  "groups": [
    {
      "provider_corp_external_id": "PROVIDER-001",
      "items": [
        {
          "provider_item_uuid": "prov-item-uuid",
          "item_uuid": "item-uuid",
          "batch_no": "LOT-2025-001",
          "qty": 500,
          "price_per_uom": 9.50,
          "guardrail_price_per_uom": 9.50,
          "slow_move_item": true,
          "expired_at": "2026-03-15T00:00:00Z",
          "subtotal": 4750.00
        }
      ],
      "group_subtotal": 4750.00
    }
  ]
}

主要特点:

  • 对所有价格层使用单批优化的GraphQL查询
  • 按provider_corp_external_id对项目进行分组,以便进行多提供商比较
  • 包括带有slow_move_item标志的批次特定定价和护栏定价
  • 不应用折扣的退货定价结构(LLM可以单独使用get_discount_prompts)

更新于v0.1.1:已重构为使用基于电子邮件的批处理加载器,而不是segment_uuid。价格等级和折扣提示现在可以通过专用的批量优化功能单独获取。

______________________________________________________________________

5.安装管理(4个工具)

create_installment

为报价设置分期付款。

需求:

  • 报价必须在 confirmed 创建分期付款的状态

工作流程:

  • 创建分期付款 status=pending 当报价状态更改为 confirmed
  • 更新分期付款 status=paid 收到付款时
  • 当所有分期付款 paid,报价状态自动设置为 completed

自动行为:

  • 金额:如果 installment_amount 未提供,使用全部剩余余额。如果提供,使用 min(requested_amount, remaining_balance) (剩余余额自动封顶)
  • 优先级:自动设置为 max(existing_priorities) + 1 用于顺序订购(第一期从0开始)
  • 截止日期:自动设置为当前时间(无需指定)
  • 安装率:后端根据以下内容自动计算 installment_amount / final_total_quote_amount
  • 自动加盖:请求金额>剩余余额自动使用剩余余额

输入选项:

选项1:全部剩余余额(自动)

{
  "quote_uuid": "quote-uuid",
  "request_uuid": "request-uuid",
  "status": "pending"
}

选项2:部分分期付款(自定义金额)

{
  "quote_uuid": "quote-uuid",
  "request_uuid": "request-uuid",
  "installment_amount": 3000.00,
  "status": "pending"
}

分期付款状态值:

  • pending:已安排付款但尚未收到(确认报价时默认)
  • paid:已收到并验证付款
  • cancelled:付款已取消或退还

验证规则:

  • 未安装_amount:使用全部剩余余额(final_total_quote_amount - existing_pending_paid_total)
  • 安装_挂载:必须大于0。如果超过剩余余额,则自动以剩余余额为上限
  • 如果剩余余额≤0(报价已完全覆盖),则分期付款创建被阻止
  • 取消的分期付款不计入总额
  • 支持多个部分分期付款,加起来就是报价总额
  • 自动封顶确保您永远不会超过报价总额(可以安全地要求任何金额)

输出: 带有自动计算金额、到期日和安装比率的安装记录。

update_installment

更新分期付款状态和销售订单号。

状态转换:所有状态更改都根据分期付款状态流进行验证。

自动业务规则:

  • 当所有分期付款都标记为 paid,报价自动设置为 completed

使用案例:

  • 将分期付款标记为 paid 收到付款时
  • 将分期付款标记为 cancelled 如果付款被取消或退款
  • 将分期付款链接到销售订单号以进行跟踪

输入:

{
  "quote_uuid": "quote-uuid",
  "installment_uuid": "installment-uuid",
  "status": "paid",
  "salesorder_no": "SO-12345"
}

常用用法:

// Mark as paid (triggers auto-complete check)
{
  "quote_uuid": "quote-uuid",
  "installment_uuid": "installment-uuid",
  "status": "paid"
}

// Link to sales order
{
  "quote_uuid": "quote-uuid",
  "installment_uuid": "installment-uuid",
  "salesorder_no": "SO-12345"
}

// Both at once
{
  "quote_uuid": "quote-uuid",
  "installment_uuid": "installment-uuid",
  "status": "paid",
  "salesorder_no": "SO-12345"
}

输出: 已更新分期付款记录。

create_installments

根据付款计划为报价创建多个分期付款。自动化设置分期付款计划的过程(例如,一年内的每月付款)。

工作流程:

  • 计算剩余余额(final_total_quote_amount - existing_pending_paid_total)
  • 将剩余余额平均分配给 interval_num 分期付款
  • 根据以下内容计算计划日期 interval_numtotal_pay_period
  • 创建所有分期付款 status=pending
  • 自动增加顺序订购的优先级

自动行为:

  • 每期金额: remaining_balance / interval_num (平均分配)
  • 计划日期:第一期分期付款计划在下一个付款期(不是本期)进行,然后定期进行后续分期付款。所有计划都安排在每月的配置日期(默认值:15日),使用 installment_scheduled_day 设置。如果一个月中不存在该日(例如2月31日),则使用该月的最后一天。使用钟摆库进行精确的日期计算。
  • 优先级:每次分期付款自动递增
  • 状态:使用创建的所有分期付款 pending 状态

输入:

{
  "quote_uuid": "quote-uuid",
  "request_uuid": "request-uuid",
  "interval_num": 12,
  "total_pay_period": 12
}

示例:

1年内12个月付款:

{
  "quote_uuid": "quote-uuid",
  "request_uuid": "request-uuid",
  "interval_num": 12,
  "total_pay_period": 12
}
// Creates 12 installments, scheduled monthly (every 1 month)
// First installment: Next month on 15th (or configured day)
// Last installment: 12 months from now on 15th
// Amount per installment: remaining_balance / 12

1年内每月支付6次:

{
  "quote_uuid": "quote-uuid",
  "request_uuid": "request-uuid",
  "interval_num": 6,
  "total_pay_period": 12
}
// Creates 6 installments, scheduled bi-monthly (every 2 months)
// First installment: 2 months from now on 15th
// Last installment: 12 months from now on 15th
// Amount per installment: remaining_balance / 6

2年内4次季度付款:

{
  "quote_uuid": "quote-uuid",
  "request_uuid": "request-uuid",
  "interval_num": 4,
  "total_pay_period": 24
}
// Creates 4 installments, scheduled every 6 months
// First installment: 6 months from now on 15th
// Last installment: 24 months from now on 15th
// Amount per installment: remaining_balance / 4

验证规则:

  • interval_num 必须大于0
  • total_pay_period 必须大于0
  • 剩余余额必须大于0(报价尚未完全覆盖)
  • 如果任何分期付款创建失败,将返回错误以及创建内容的详细信息

输出:

{
  "installments": [ /* array of created installment objects */ ],
  "total_created": 12,
  "installment_amount_per": 833.33,
  "total_installment_amount": 10000.00
}

get_installments

检索分期付款以获取报价。

输入:

{
  "quote_uuid": "quote-uuid"
}

输出: 分期付款清单及付款时间表。

______________________________________________________________________

6.工作流程便利性(2个工具)

这些助手组合了多个操作,并执行上述相同的业务规则。

confirm_request_and_create_quotes

将请求设置为 confirmed 并在一次通话中为提供商列表创建报价。使用请求上的提供者分配来生成报价项。销售代表电子邮件可以通过设置提供(sales_rep_emails 映射)。

confirm_quote_and_create_installments

确认报价,不批准同一请求的竞争报价,并创建单个分期付款或分期付款计划。

______________________________________________________________________

7.文档管理(2个工具)

upload_rfq_file

上传与RFQ请求相关的文档。

输入:

{
  "request_uuid": "request-uuid",
  "file_name": "specifications.pdf",
  "file_url": "s3://bucket/path/to/file",
  "file_type": "application/pdf",
  "email": "requester@company.com",
  "notes": "Technical specifications"
}

输出: 带有元数据的文件记录。

get_rfq_files

检索与请求关联的文件。

输入:

{
  "request_uuid": "request-uuid"
}

输出: 带有下载URL的已上传文件列表。

______________________________________________________________________

8.细分管理(1个工具)

注: 分段通常通过后端管理界面进行管理。此工具提供对细分联系人关联的只读访问,以便进行定价查找。

get_segment_contacts

按消费者公司或电子邮件列出细分市场中的联系人。

输入:

{
  "consumer_corp_external_id": "CUSTOMER-001",
  "email": "buyer@customer.com",
  "page_number": 1,
  "limit": 50
}

输出: 与其部门关联的联系人列表。

______________________________________________________________________

使用示例

完成从询价到报价的工作流程

有关从客户查询到最终报价确认的详细14步工作流程,请参阅 DEVELMENT_PLAN.md-完成从询价到报价的工作流程.

快速概述: 0.查找客户细分

  1. 提交询价请求
  2. 与最终用户一起查找项目
  3. 向请求添加项目
  4. 查找每个项目的提供程序项目
  5. 查找每个提供程序项的批次(可选)
  6. 将提供者项目分配给请求项目
  7. 计算报价定价 (新增-按提供商/细分市场分组,返回折扣规则)
  8. 通过确认生成报价
  9. 与最终用户协商
  10. 通过用户确认申请折扣
  11. 更新发货报价
  12. 确认报价并生成分期付款计划
  13. 完成报价并处理付款

实例:端到端报价生成

# Step 0: Find customer segment
segment_contacts = processor.get_segment_contacts(
    consumer_corp_external_id="CUSTOMER-001",
    email="buyer@customer.com"
)
segment_uuid = segment_contacts[0]["segment_uuid"]

# Step 1-3: Create request and add items
request = processor.submit_rfq_request(
    email="buyer@customer.com",
    request_title="Q1 Production Materials",
    items=[]
)
request_uuid = request["request_uuid"]

processor.add_item_to_rfq_request(
    request_uuid=request_uuid,
    item={"item_uuid": "item-uuid-1", "qty": 500}
)

# Step 4-6: Assign provider items to request
current_request = processor.get_rfq_request(request_uuid=request_uuid)
updated_items = current_request["items"].copy()
updated_items[0]["provider_items"] = [
    {
        "provider_corp_external_id": "PROVIDER-001",
        "provider_item_uuid": "prov-item-uuid-1",
        "batch_no": "LOT-2025-001",
        "qty": 500
    }
]
processor.update_rfq_request(request_uuid=request_uuid, items=updated_items)

# Step 7: Calculate pricing with batch optimization (NEW)
pricing = processor.calculate_quote_pricing(
    request_uuid=request_uuid,
    email="buyer@customer.com"  # Uses email instead of segment_uuid
)
# Returns grouped pricing structure with items by provider
# {
#   "groups": [{
#     "provider_corp_external_id": "PROVIDER-001",
#     "items": [{
#       "provider_item_uuid": "prov-item-uuid-1",
#       "item_uuid": "item-uuid-1",
#       "batch_no": "LOT-2025-001",
#       "qty": 500,
#       "price_per_uom": 9.50,
#       "guardrail_price_per_uom": 9.50,
#       "slow_move_item": true,
#       "expired_at": "2026-03-15T00:00:00Z",
#       "subtotal": 4750.00
#     }],
#     "group_subtotal": 4750.00
#   }]
# }

# Optional: Get discount prompts separately
discount_prompts = processor.get_discount_prompts(
    email="buyer@customer.com",
    quote_items=[{
        "item_uuid": "item-uuid-1",
        "provider_item_uuid": "prov-item-uuid-1"
    }]
)

# Step 8-10: Create quote (quote items are auto-created from provider assignments)
quote = processor.create_quote(
    request_uuid=request_uuid,
    provider_corp_external_id="PROVIDER-001",
    sales_rep_email="sales@provider1.com"
)

# Apply discount to the created quote item
full_quote = processor.get_quote(
    request_uuid=request_uuid,
    quote_uuid=quote["quote_uuid"],
)
first_quote_item_uuid = full_quote["quote_items"][0]["quote_item_uuid"]

processor.update_quote_item(
    quote_uuid=quote["quote_uuid"],
    quote_item_uuid=first_quote_item_uuid,
    request_uuid=request_uuid,
    discount_amount=237.50  # 5% slow-move discount (user confirmed)
)

# Step 11: Add shipping
processor.update_quote(
    request_uuid=request_uuid,
    quote_uuid=quote["quote_uuid"],
    shipping_method="express",
    shipping_amount=75.00
)

# Step 12-13: Create installment plan and submit
# Installment automatically uses quote's final_total_quote_amount
processor.create_installment(
    request_uuid=request_uuid,
    quote_uuid=quote["quote_uuid"],
    status="pending"  # Default status when quote is confirmed
)

processor.update_quote(
    request_uuid=request_uuid,
    quote_uuid=quote["quote_uuid"],
    status="confirmed"
)

关键原则

  • LLM驱动:LLM在每一步都会向用户提问
  • 基于段:始终首先确定客户细分,以便正确定价
  • 信息提供者: calculate_quote_pricing 提供折扣规则;LLM根据用户输入做出决策
  • 用户确认:只有在用户确认后才能应用折扣
  • 多供应商:为每个提供商创建单独的报价以供比较

AI助手对话示例

User: I need a quote for 500 units of part ABC-123

目录标签

目录标签

PythonClaude搜索报价管理本地部署库存搜索分期付款规划文件管理定价智能

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

29

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP