Skip to main content

Discovery Documents

CTP tools are discoverable through multiple standardized formats.

Supported Formats

FormatPurposeConsumers
OpenAPI 3.1API documentationSwagger, Postman, API clients
MCP ManifestAI tool integrationClaude, Cursor, AI assistants
llms.txtLLM contextLLM-based applications
CTP ManifestNative CTP discoveryConveniencePro ecosystem
ChatGPT PluginChatGPT integrationOpenAI plugins

OpenAPI 3.1 Specification

import { generateOpenAPISpec } from '@conveniencepro/ctp-discovery';

const spec = generateOpenAPISpec(tools, {
  info: {
    title: 'My Tools API',
    version: '1.0.0',
    description: 'Collection of developer tools',
  },
  servers: [
    { url: 'https://api.example.com/v1' },
  ],
});

Generated Structure

openapi: "3.1.0"
info:
  title: "My Tools API"
  version: "1.0.0"
paths:
  /tools/json-formatter:
    post:
      operationId: "json-formatter"
      summary: "JSON Formatter"
      description: "Format, validate, and beautify JSON data"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required: ["json"]
              properties:
                json:
                  type: string
                  description: "JSON string to format"
                indent:
                  type: string
                  enum: ["0", "2", "4", "tab"]
                  default: "2"
      responses:
        "200":
          description: "Success"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ToolResult"

MCP Manifest

Generate Model Context Protocol compatible manifests:
import { generateMCPManifest } from '@conveniencepro/ctp-discovery';

const manifest = generateMCPManifest(tools, {
  name: 'my-tools',
  version: '1.0.0',
  description: 'Developer tool collection',
});

Generated Structure

{
  "name": "my-tools",
  "version": "1.0.0",
  "description": "Developer tool collection",
  "tools": [
    {
      "name": "json-formatter",
      "title": "JSON Formatter",
      "description": "Format, validate, and beautify JSON data",
      "inputSchema": {
        "type": "object",
        "required": ["json"],
        "properties": {
          "json": {
            "type": "string",
            "description": "JSON string to format"
          },
          "indent": {
            "type": "string",
            "enum": ["0", "2", "4", "tab"],
            "default": "2"
          }
        }
      }
    }
  ]
}

llms.txt

Generate context documents for LLMs:
import { generateLlmsTxt } from '@conveniencepro/ctp-discovery';

const llmsTxt = generateLlmsTxt(tools, {
  baseUrl: 'https://conveniencepro.cc',
  name: 'ConveniencePro Tools',
});

Generated Structure

# ConveniencePro Tools

> Developer tools for formatting, encoding, and generating data.

## Available Tools

### json-formatter
Format, validate, and beautify JSON data with customizable indentation.

**Parameters:**
- `json` (required): JSON string to format
- `indent`: Indentation style (0, 2, 4, tab). Default: 2
- `sortKeys`: Sort object keys alphabetically

**Example:**
Input: {"b":2,"a":1}
Output: {
  "a": 1,
  "b": 2
}

---

### base64-encoder
Encode text to Base64 or decode Base64 back to text.
...

CTP Manifest

Native CTP discovery format:
import { generateCTPManifest } from '@conveniencepro/ctp-discovery';

const manifest = generateCTPManifest(tools, {
  name: 'my-tools',
  version: '1.0.0',
  baseUrl: 'https://api.example.com',
});

Structure

{
  "$schema": "https://conveniencepro.cc/schemas/ctp-manifest.schema.json",
  "version": "1.0.0",
  "name": "my-tools",
  "description": "Developer tool collection",
  "baseUrl": "https://api.example.com",
  "tools": [
    {
      "id": "json-formatter",
      "path": "/tools/json-formatter",
      "definition": { /* full tool definition */ }
    }
  ],
  "categories": ["formatters", "encoders", "generators"],
  "generatedAt": "2024-01-15T12:00:00Z"
}

Serving Discovery Documents

Express.js Example

import express from 'express';
import {
  generateOpenAPISpec,
  generateMCPManifest,
  generateLlmsTxt,
} from '@conveniencepro/ctp-discovery';

const app = express();

// OpenAPI spec
app.get('/openapi.json', (req, res) => {
  res.json(generateOpenAPISpec(tools));
});

// MCP manifest
app.get('/.well-known/mcp.json', (req, res) => {
  res.json(generateMCPManifest(tools));
});

// llms.txt
app.get('/llms.txt', (req, res) => {
  res.type('text/plain').send(generateLlmsTxt(tools));
});

Static Generation

import { writeFileSync } from 'fs';

// Generate at build time
writeFileSync('public/openapi.json', JSON.stringify(generateOpenAPISpec(tools)));
writeFileSync('public/.well-known/mcp.json', JSON.stringify(generateMCPManifest(tools)));
writeFileSync('public/llms.txt', generateLlmsTxt(tools));

Well-Known URLs

CTP recommends these standard paths:
PathFormatPurpose
/openapi.jsonOpenAPI 3.1API documentation
/.well-known/mcp.jsonMCPAI tool discovery
/llms.txtTextLLM context
/.well-known/ctp.jsonCTPNative discovery
/.well-known/ai-plugin.jsonChatGPTPlugin manifest