diff --git a/apps/web/src/app/docs/page.tsx b/apps/web/src/app/docs/page.tsx index 80ecc2c..3fa6ba7 100644 --- a/apps/web/src/app/docs/page.tsx +++ b/apps/web/src/app/docs/page.tsx @@ -841,8 +841,16 @@ while (true) {

The tpmjs field in package.json describes your - tool's capabilities. + tool. TPMJS automatically extracts parameter schemas from your tool code, so you + only need to provide basic metadata.

+
+

+ ✨ Auto Schema Extraction: Parameters + are automatically extracted from your tool's Zod inputSchema - no need to + document them manually! +

+
- +

- There are three tiers of metadata. Higher tiers get better visibility and quality - scores. + TPMJS now auto-extracts parameter schemas, simplifying what you need to provide.

- Tier 1: Minimal - 1x multiplier + Required

- Required fields only: category,{' '} - description,{' '} - exportName + category,{' '} + tools (with{' '} + exportName +{' '} + description)

- Tier 2: Basic - 2x multiplier + Optional

- + parameters and{' '} - returns documentation + env (API keys),{' '} + frameworks (compatibility)

- Tier 3: Rich - 4x multiplier + Auto-extracted

- + env,{' '} - frameworks,{' '} - aiAgent (useCase, limitations, examples) + parameters,{' '} + returns,{' '} + aiAgent - extracted from your tool code

@@ -1087,6 +1080,10 @@ export TPMJS_EXECUTOR_URL=https://executor.mycompany.com`} q: 'How long does it take for my tool to appear?', a: 'Tools are discovered within 2-15 minutes of publishing to npm. Make sure you have the "tpmjs-tool" keyword in your package.json.', }, + { + q: 'How does schema extraction work?', + a: "TPMJS automatically loads your tool in a sandbox and extracts the inputSchema from your Zod definition. You don't need to manually document parameters.", + }, { q: 'Is TPMJS free to use?', a: 'Yes! TPMJS is free for public tools. We may introduce paid tiers for private registries and enterprise features in the future.', @@ -1099,10 +1096,6 @@ export TPMJS_EXECUTOR_URL=https://executor.mycompany.com`} q: 'How are tools executed?', a: 'Tools are dynamically loaded from esm.sh and executed in a sandboxed Deno runtime on Railway. No local installation is required.', }, - { - q: 'Can I run my own TPMJS registry?', - a: 'Yes! Set the TPMJS_API_URL and TPMJS_EXECUTOR_URL environment variables to point to your own infrastructure.', - }, ].map((item) => (

{item.q}

diff --git a/apps/web/src/app/faq/page.tsx b/apps/web/src/app/faq/page.tsx index 0e38935..b47a8f5 100644 --- a/apps/web/src/app/faq/page.tsx +++ b/apps/web/src/app/faq/page.tsx @@ -113,36 +113,36 @@ export default function FAQPage(): React.ReactElement { - {/* Question 3: What are the metadata tiers? */} - + {/* Question 3: How does schema extraction work? */} +

- TPMJS supports three metadata tiers, each providing different levels of detail and - affecting your tool's quality score: + TPMJS automatically extracts your tool's input schema (parameters) by loading + and analyzing your tool code in a sandboxed environment. This means you don't + need to manually document parameters in package.json.

  • - Tier 1: Minimal (1x multiplier) - - Basic metadata with category, frameworks, and simple tool descriptions. Quick to - set up but lower visibility. + During sync - When your package is + discovered or updated, TPMJS loads it via esm.sh and reads the inputSchema from + your exported tool.
  • - Tier 2: Basic (2x multiplier) - Adds - parameter and return type information, helping AI agents understand how to use - your tool. + Schema source badge - Tool pages show + whether the schema was "Auto-extracted" or "Author-provided" + (fallback).
  • - Tier 3: Rich (4x multiplier) - Full - documentation including AI agent guidance, use cases, limitations, examples, and - environment variables. Gets the best visibility and quality score. + Manual re-extraction - Users can + trigger re-extraction from the tool page if needed.

- Higher tiers get better quality scores and more visibility in search results. Learn - more on our{' '} - - publishing guide - - . + This simplifies publishing - you only need to provide category, description, and + exportName. See our{' '} + + specification + {' '} + for details.

diff --git a/apps/web/src/app/how-it-works/page.tsx b/apps/web/src/app/how-it-works/page.tsx index 4b80bab..37ba788 100644 --- a/apps/web/src/app/how-it-works/page.tsx +++ b/apps/web/src/app/how-it-works/page.tsx @@ -98,21 +98,15 @@ export default function HowItWorksPage(): React.ReactElement { "frameworks": ["vercel-ai"], "tools": [{ "exportName": "analyzeSentiment", - "description": "Analyze sentiment of text", - "parameters": [{ - "name": "text", - "type": "string", - "description": "Text to analyze", - "required": true - }], - "returns": { - "type": "string", - "description": "Sentiment score" - } + "description": "Analyze sentiment of text and return positive/negative/neutral" }] } }`} /> +

+ Parameters are automatically extracted from your tool code - no need to list them + manually! +

{/* Step 2 */} @@ -232,11 +226,13 @@ const result = await streamText({ - {/* 2. Validation */} + {/* 2. Validation & Schema Extraction */}
-

2. Validation

+

+ 2. Validation & Schema Extraction +

- Every discovered package is validated against the TPMJS schema: + Every discovered package is validated and its schema is automatically extracted:

  • @@ -249,15 +245,18 @@ const result = await streamText({
  • - Parameters follow type schema (string, number, boolean, etc.) + + inputSchema auto-extracted from + tool code via sandboxed executor +
  • - Environment variables properly documented + Parameters derived from JSON Schema for display
  • - Supports legacy single-tool and modern multi-tool formats + Fallback to author-provided parameters if extraction fails
diff --git a/apps/web/src/app/publish/page.tsx b/apps/web/src/app/publish/page.tsx index 6ee45e7..405b321 100644 --- a/apps/web/src/app/publish/page.tsx +++ b/apps/web/src/app/publish/page.tsx @@ -116,100 +116,76 @@ export default function PublishPage(): React.ReactElement { /> - {/* Step 2: Metadata Tiers */} + {/* Step 2: Metadata */}

Step 2: Add TPMJS Metadata

- There are three tiers of metadata. Higher tiers get better visibility and quality - scores. + Add a tpmjs{' '} + field to your package.json. TPMJS automatically extracts parameter schemas from your + tool code, so you only need to provide basic metadata.

- {/* Tier 1: Minimal */} -
-
- - Tier 1: Minimal - - Required fields only + {/* Auto-extraction callout */} +
+
+
+
+

+ Automatic Schema Extraction +

+

+ TPMJS automatically extracts your tool's input schema by analyzing your + code. You don't need to manually document parameters, returns, or AI agent + guidance in package.json - we extract it from your Zod schema automatically. +

+
- -

- Quality Score: 1x base multiplier -

- {/* Tier 2: Basic */} + {/* Minimal Example */}
- Tier 2: Basic + Required Fields - Add parameter & return info + All you need to provide

- Quality Score: 2x base multiplier + That's it! Parameters are automatically extracted from your tool code.

- {/* Tier 3: Rich */} + {/* With Optional Fields */}
- Tier 3: Rich + With Optional Fields + + + Add env vars and framework compatibility - Full documentation

- Quality Score: 4x base multiplier 🚀 + Add env for API keys and{' '} + frameworks for compatibility info.

@@ -341,30 +308,16 @@ npm publish --access public "tools": [ { "exportName": "createBlogPostTool", - "description": "Creates structured blog posts with frontmatter and SEO metadata", - "parameters": [ - { - "name": "title", - "type": "string", - "description": "The title of the blog post", - "required": true - }, - { - "name": "content", - "type": "string", - "description": "The main content", - "required": true - } - ], - "returns": { - "type": "BlogPost", - "description": "Structured blog post with frontmatter" - } + "description": "Creates structured blog posts with frontmatter and SEO metadata" } ] } }`} /> +

+ Note: Parameters are automatically extracted from the tool code - no need to list them + in package.json! +

{/* Tips */} @@ -378,9 +331,9 @@ npm publish --access public desc: 'Make your package name clear and searchable', }, { - icon: '📊', - title: 'Complete metadata', - desc: 'Rich tier tools get 4x better visibility', + icon: '✨', + title: 'Good Zod schemas', + desc: 'Add descriptions to your Zod schema fields - they get auto-extracted', }, { icon: '📚', @@ -393,9 +346,9 @@ npm publish --access public desc: 'Regular updates boost download counts', }, { - icon: '🤖', - title: 'AI-friendly descriptions', - desc: 'Write aiAgent.useCase as guidance for AI agents', + icon: '🔑', + title: 'Document env vars', + desc: 'List required API keys in the env field so users know what they need', }, ].map((tip) => (
The TPMJS specification defines a{' '} tpmjs field in - package.json with three tiers of metadata. Higher tiers receive better visibility and - quality scores. + package.json. TPMJS automatically extracts parameter schemas from your tool code, so + you only need to provide basic metadata.

- {/* Tier 1: Minimal */} + {/* Auto-extraction callout */} +
+
+
+
+

+ Automatic Schema Extraction +

+

+ TPMJS automatically extracts your tool's input schema (parameters) by + analyzing your code when it syncs. You no longer need to manually document + parameters, returns, or AI agent guidance in package.json. +

+
+
+ inputSchema +

+ Auto-extracted from your Zod schema +

+
+
+ parameters +

+ Derived from inputSchema automatically +

+
+
+ Tool page +

+ Shows extracted schema with source badge +

+
+
+
+
+
+ + {/* Required Fields */}
- - Tier 1: Minimal + + Required Fields - Required fields only + What you need to provide
@@ -147,23 +184,33 @@ export default function SpecPage(): React.ReactElement {

- description * + tools *

-

- Clear description of what the tool does. Must be 20-500 characters. This - appears in search results and tool listings. +

+ Array of tools exported by your package. Each tool needs:

+
    +
  • + exportName - The exported + function name (required) +
  • +
  • + description - What the tool does, + 20-500 chars (required) +
  • +
-
Example:
+
Minimal Example:
+

+ That's it! TPMJS will automatically extract the inputSchema from your + tool when it syncs. +

- {/* Tier 2: Basic */} -
-
- - Tier 2: Basic - - - + Parameter and return type documentation - -
- - -
-
-

- parameters -

-

- Array of parameter objects describing function inputs. Each parameter has: -

-
    -
  • - name - Parameter name -
  • -
  • - type - TypeScript type -
  • -
  • - description - What it does -
  • -
  • - required - Boolean -
  • -
  • - default - Default value - (optional) -
  • -
-
- -
-

- returns -

-

- Object describing the return value: -

-
    -
  • - type - Return type -
  • -
  • - description - What is returned -
  • -
-
-
- -
-
Example:
- -
-
-
-
- - {/* Tier 3: Rich */} + {/* Optional Fields */}
- Tier 3: Rich + Optional Fields - + Complete metadata for maximum visibility + Additional metadata for better visibility
@@ -310,10 +262,6 @@ export default function SpecPage(): React.ReactElement { required - Boolean (defaults to true) -
  • - default - Default value if not - provided (optional) -
  • @@ -338,39 +286,17 @@ export default function SpecPage(): React.ReactElement { ))} - -
    -

    - aiAgent -

    -

    - AI agent integration guidance. Helps LLMs understand when and how to use - your tool: -

    -
      -
    • - useCase - When to use this tool - (min 10 chars, required) -
    • -
    • - limitations - Known constraints - (optional) -
    • -
    • - examples - Array of example use - cases (optional) -
    • -
    -
    - Complete Example: + Complete Example with Optional Fields:
    + + {/* Deprecated Fields */} +
    +
    + + Deprecated + + + Now auto-extracted (kept for backward compatibility) + +
    + + +

    + The following fields are now automatically extracted from your tool code. You no + longer need to specify them manually: +

    +
      +
    • + + parameters + + → Auto-extracted from tool's Zod inputSchema +
    • +
    • + returns + → Auto-extracted from tool definition +
    • +
    • + aiAgent + → Auto-extracted from tool metadata +
    • +
    +

    + If auto-extraction fails, TPMJS will fall back to any manually provided values. +

    +
    +
    +
    + + + {/* Schema Extraction */} +
    +

    Schema Extraction

    +

    + When TPMJS syncs your package, it automatically extracts your tool's inputSchema + by loading and inspecting your tool in a sandboxed environment. +

    +
    + + +
    🔄
    + During Sync +
    + +

    + Schema is extracted automatically when your package is discovered or updated +

    +
    +
    + + + +
    🏷️
    + Source Badge +
    + +

    + Tool pages show whether schema was "Auto-extracted" or + "Author-provided" +

    +
    +
    + + + +
    🔁
    + Manual Re-extract +
    + +

    + Users can trigger re-extraction from the tool page if needed +

    +
    +
    +
    + + +

    How It Works:

    +
      +
    1. Your tool is loaded in a Deno sandbox via esm.sh
    2. +
    3. + The inputSchema property is read from + your exported tool +
    4. +
    5. The JSON Schema is stored in our database
    6. +
    7. Parameters are derived from the schema for display
    8. +
    +
    +
    {/* Field Reference Table */} @@ -417,7 +433,6 @@ export default function SpecPage(): React.ReactElement { Field Type - Tier Required Description @@ -428,11 +443,6 @@ export default function SpecPage(): React.ReactElement { category string - - - Minimal - - Yes @@ -440,55 +450,21 @@ export default function SpecPage(): React.ReactElement { - description - - string - - - Minimal - - - - Yes - - Tool description (20-500 chars) - - - - parameters + tools array - - Basic - + Yes - No - Function parameter definitions - - - returns + Array of tool definitions (exportName + description) - object - - - Basic - - - No - Return type definition env array - - - Rich - - No Required environment variables @@ -497,26 +473,50 @@ export default function SpecPage(): React.ReactElement { frameworks array - - - Rich - - No Compatible AI frameworks - + - aiAgent + parameters - object + array - - Rich + + Deprecated - No - AI agent integration guidance + + Auto-extracted from tool + + + + + returns + + object + + + Deprecated + + + + Auto-extracted from tool + + + + + aiAgent + + object + + + Deprecated + + + + Auto-extracted from tool +