30-tests-and-output

30-tests-and-output is a cursor rule for Cursor from marianfoo/mcp-sap-docs. It costs 510 tokens per session, scanned A, original, Apache-2.0.

A set of project rules and tests for checking search results, retrieved documents, output formatting, and end-to-end tool behavior.

In plain words
What is it for?
Use it when changing search, document retrieval, result formatting, integration behavior, or performance-related tests.
Why use it?
It reduces the risk that changes break the expected search output or make tests unreliable. It also checks response details such as numeric scores and context markers.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/marianfoo/mcp-sap-docs/30-tests-and-output
Clone the repo
git clone --depth 1 https://github.com/marianfoo/mcp-sap-docs

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 30-tests-and-output

README.md
[![agentmods](https://agentmods.dev/badge/rules/marianfoo/mcp-sap-docs/30-tests-and-output.svg)](https://agentmods.dev/rules/marianfoo/mcp-sap-docs/30-tests-and-output)
Your own site
<a href="https://agentmods.dev/rules/marianfoo/mcp-sap-docs/30-tests-and-output"><img src="https://agentmods.dev/badge/rules/marianfoo/mcp-sap-docs/30-tests-and-output.svg" alt="Measured on agentmods" height="20"></a>
Per session 510 This file is loaded in full into every session.
When invoked 510 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00510 $0.00510
Opus 5 $0.00255 $0.00255
Sonnet 5 $0.00102 $0.00102
Haiku 4.5 $0.00051 $0.00051

Measured 6d ago against content hash 95a8ed8e4a06, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

30-tests-and-output scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.cursor/rules/30-tests-and-output.mdc · 56 lines

What it actually says

Tests & Expected Output (Rule)

When changing output formatting or test stability.

Test Architecture

  • Test Runner: test/tools/run-tests.js - Unified test execution
  • HTTP Client: test/_utils/httpClient.js - Server interaction utilities
  • Result Parser: test/_utils/parseResults.js - Output format validation
  • Smoke Tests: test/tools/search.smoke.js - Quick functionality validation

Expected Output Format (BM25-Only)

⭐️ **<document-id>** (Score: <final-score>)
   <description-preview>
   Use in sap_docs_get

Test Categories

  • Search Tests: Verify query results and context detection
  • Retrieval Tests: Document fetching and formatting
  • Integration Tests: End-to-end MCP tool functionality
  • Performance Tests: Response time and resource usage

Test Data Structure

{
  name: 'Test Name',
  tool: 'sap_docs_search',
  query: 'search term',
  expectIncludes: ['/expected/document/id'],
  validate: (results) => { /* custom validation */ }
}

Output Validation

  • Score Format: Numeric scores with 2 decimal places
  • Context Indicators: Emoji-based context detection (🎨🏗️🧪)
  • Source Attribution: Clear library identification
  • Result Limits: Configurable via CONFIG.RETURN_K (default: 25)

Test Execution

  • Fast Tests: npm run test:fast - Skip build, use existing artifacts
  • Full Tests: npm run test - Build + test complete pipeline
  • Smoke Tests: npm run test:smoke - Quick validation only
  • Community Tests: npm run test:community - SAP Community search functionality
  • MCP Inspector: npm run inspect - Debug MCP protocol interactions

@file test/tools/run-tests.js @file test/_utils/parseResults.js @file test/_utils/httpClient.js @file test/tools/search.smoke.js @file test/tools/sap_docs_search/search-cap-docs.js @file test/tools/sap_docs_search/search-cloud-sdk-js.js @file test/tools/sap_docs_search/search-sapui5-docs.js @file docs/TESTS.md @file docs/DEV.md

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 56 lines · 510 tokens per session scan A 95a8ed8e4a06

Subscribe to this mod's changes

30-tests-and-output is a cursor rule published in the GitHub repository marianfoo/mcp-sap-docs (219 stars, last pushed today), licensed Apache-2.0. It adds 510 tokens to every session, about $0.0026 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.