bel-crm-db

Read and write PostgreSQL MCP CRM records with single-statement SQL queries.

2|Updated Oct 22, 2025
One-click install
npx skills add https://github.com/bennoloeffler/bassi --skill bel-crm-db
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bel-crm-db
Source: https://github.com/bennoloeffler/bassi/tree/main/.claude/skills/bel-crm-db
Command: npx skills add https://github.com/bennoloeffler/bassi --skill bel-crm-db

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides safe, schema-aware CRM data operations by documenting the PostgreSQL MCP server limitations and the CRM schema, reducing guesswork and preventing common errors when reading or writing CRM data.

Core Features & Use Cases

  • Schema-aware guidance for tables like company_site, person, sales_opportunity, and event, including how related data flows between entities.
  • Safe SQL patterns: two-step insert-and-read patterns to obtain IDs without using forbidden constructs.
  • Use Case: insert a new company_site, then retrieve its ID with a separate read_query to link related records.

Quick Start

Before attempting inserts, refer to bel-crm-sql-rules and apply the recommended two-step pattern (write, then read) to obtain IDs in MCP contexts.

Frequently Asked Questions about bel-crm-db

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely insert and read CRM data in PostgreSQL without using RETURNING or ON CONFLICT?

Safe CRM data operations use a two-step pattern: execute a single write_query to insert the record, then execute a separate read_query to retrieve the generated ID. This approach respects MCP SQL constraints and allows you to link related records across sales_opportunity, person, and company_site entities without forbidden constructs.

What SQL patterns should I follow when managing CRM entities in a PostgreSQL MCP database?

The bel-crm-sql-rules define schema-aware patterns for CRM tables including company_site, person, sales_opportunity, and event. Key rules: use single-statement write_query and read_query calls, avoid RETURNING and ON CONFLICT clauses, and sequence insert-then-read operations to obtain IDs and maintain historical activity across related records.

Can I use this to maintain historical and future activity records across multiple CRM entities?

Yes. The Skill manages activity tracking across company_site, person, and sales_opportunity by enforcing schema-aware insert and query patterns. Two-step write-then-read operations let you create linked records with proper ID sequencing while maintaining a complete audit trail.

What are the limitations when working with CRM data in an MCP-backed PostgreSQL database?

MCP SQL constraints prohibit RETURNING clauses and ON CONFLICT syntax. These limitations require the two-step insert-and-read pattern instead of standard single-query approaches. Plan your workflow accordingly and always reference bel-crm-sql-rules before executing writes to avoid common errors.

How do I query CRM records to link a new company_site to related sales opportunities and contacts?

After inserting a company_site with write_query, use a separate read_query to retrieve its ID. Then reference that ID in subsequent insert or update queries for related person and sales_opportunity records, maintaining relational integrity across your CRM schema.

Does this Skill work with data_files attachments in CRM records?

Yes. The Skill handles CRM entities including data_files, enabling you to store and query file attachments alongside sales_opportunity, person, company_site, and event records using the same schema-aware, MCP-compliant SQL patterns.