query-language

Query Affinity CRM records with SQL-like multi-entity filters and aggregations.

1|2|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/oneryalcin/affinity-sdk --skill query-language
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: query-language
Source: https://github.com/oneryalcin/affinity-sdk/tree/main/mcp/.claude-plugin/skills/query-language
Command: npx skills add https://github.com/oneryalcin/affinity-sdk --skill query-language

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables building and executing complex CRM queries across multiple entities using a structured query language, eliminating manual scripting and repetitive data pulls.

Core Features & Use Cases

  • Structured, SQL-like queries: from, where, include, select, orderBy, groupBy, aggregate, and limit constructs to drive powerful data retrieval.
  • Multi-entity joins & relationships: fetch related entities in a single, optimized query for comprehensive insights.
  • Advanced filtering & aggregation: supports complex boolean logic, counting, sums, averages, and grouping by status or other dimensions.
  • Use Case: analysts can perform cross-entity analyses (e.g., total deal value by stage, active leads by source) without writing custom scripts.

Quick Start

To fetch the first 10 persons: { "from": "persons", "limit": 10 }

You can extend to filtered results, includes, and aggregates, e.g., {"from": "opportunities", "where": {"path": "amount", "op": "gt", "value": 10000}, "aggregate": {"totalValue": {"sum": "amount"}}, "limit": 100}

Frequently Asked Questions about query-language

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

FAQPage Schema
How do I query Affinity CRM data with complex filters and aggregations?

You can query Affinity CRM data using a structured, SQL-like language that supports where, aggregate, and groupBy constructs to apply complex filters and aggregations across multiple CRM records without manual scripting.

What is the best way to perform cross-entity analysis on CRM records?

Cross-entity analysis is done by using the include construct in a structured query to fetch related entities in a single request, enabling comprehensive insights like total deal value by stage without writing custom scripts.

Can I join multiple CRM entities in a single query request?

Yes, multi-entity joins are supported through the structured query language, allowing you to fetch and relate multiple CRM entities in one optimized query for comprehensive reporting and analytical dashboards.

Do I need external software or database setup to run structured CRM queries?

No external software installation is required; the structured CRM queries leverage the built-in MCP query engine directly, eliminating the need for database setup or repetitive manual data pulls.

How do I aggregate CRM data to find total deal value by stage?

You aggregate CRM data by using the aggregate construct with sum operations in your structured query, such as setting an aggregate to sum the amount field and grouping by stage to find total deal value.