tpmjs/packages/tools/hello
Ajax Davis 9abff1f203 feat: add reusable ToolHealthBadge and ToolHealthBanner components
- Create ToolHealthBadge component in @tpmjs/ui for broken tool indicator
- Create ToolHealthBanner component in @tpmjs/ui for detailed health warnings
- Integrate both components into playground ToolsSidebar:
  - Badge shows in tool cards in left sidebar
  - Banner shows in tool detail modal
- Update search-registry to include health fields in API responses
- Add package.json exports for new health components

These components provide consistent UI for displaying broken tool status
across the application (tool search, tool detail pages, playground).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 19:12:07 +10:00
..
src feat: implement playground app with AI SDK v6 tool execution 2025-12-04 02:51:02 +10:00
CHANGELOG.md feat: implement multi-tool package architecture with manual tool registry 2025-12-04 06:39:58 +10:00
package.json feat: add reusable ToolHealthBadge and ToolHealthBanner components 2025-12-04 19:12:07 +10:00
README.md feat: implement playground app with AI SDK v6 tool execution 2025-12-04 02:51:02 +10:00
tsconfig.json feat: implement playground app with AI SDK v6 tool execution 2025-12-04 02:51:02 +10:00

@tpmjs/hello

Simple example TPMJS tools for AI SDK v6 - demonstrates how to create tools that work with AI agents.

Tools

helloWorldTool

Returns a simple "Hello, World!" greeting with a timestamp.

Parameters: None

Returns:

{
  "message": "Hello, World!",
  "timestamp": "2024-12-04T..."
}

helloNameTool

Returns a personalized greeting with the provided name.

Parameters:

  • name (string, required): The name of the person to greet

Returns:

{
  "message": "Hello, John!",
  "timestamp": "2024-12-04T..."
}

Usage

With AI SDK v6

import { streamText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { helloWorldTool, helloNameTool } from '@tpmjs/hello';

const result = streamText({
  model: openai('gpt-4o-mini'),
  messages: [{ role: 'user', content: 'Say hello to Alice' }],
  tools: {
    helloWorld: helloWorldTool,
    helloName: helloNameTool,
  },
});

Template for Creating TPMJS Tools

This package serves as a template for creating your own TPMJS tools. Key requirements:

  1. Use AI SDK v6 Beta (ai@6.0.0-beta.124)
  2. Use Zod 4 for parameter validation
  3. Export tool objects with description, parameters, and execute
  4. Add TPMJS metadata to package.json:
    "tpmjs": {
      "category": "text-analysis",
      "description": "Your tool description"
    }
    
  5. Include the tpmjs-tool keyword in package.json

Development

# Build
pnpm build

# Type check
pnpm type-check

# Watch mode
pnpm dev