ToolsPage.tsx•8.97 kB
import React from 'react';
import { H1, PageSubtitle } from '../components/Typography';
import useSEO from '../hooks/useSEO';
import ToolFilters from '../components/ToolFilters';
import ToolCard from '../components/ToolCard';
import { tools, popularTools } from '../utils/toolsData';
const ToolsPage: React.FC = () => {
useSEO({
title: 'Available Tools & APIs - SFCC Development MCP Server',
description: 'Interactive reference of SFCC Development MCP Server tools with filtering, search, examples, and quick start actions.',
keywords: 'SFCC MCP tools, Commerce Cloud APIs, log analysis, system objects, cartridge generation, best practices',
canonical: 'https://sfcc-mcp-dev.rhino-inquisitor.com/#/tools',
ogTitle: 'SFCC Development MCP Server - Tools & APIs Reference',
ogDescription: 'Browse, filter and search all MCP tools with instant example prompts to accelerate development.',
ogUrl: 'https://sfcc-mcp-dev.rhino-inquisitor.com/#/tools'
});
const [activeCategory, setActiveCategory] = React.useState('All');
const [search, setSearch] = React.useState('');
const [showPopularExpanded, setShowPopularExpanded] = React.useState(true);
const filtered = tools.filter(t => {
const inCat = activeCategory === 'All' || t.category === activeCategory;
if (!inCat) return false;
if (!search) return true;
const q = search.toLowerCase();
return (
t.name.toLowerCase().includes(q) ||
t.description.toLowerCase().includes(q) ||
t.examples?.some(e => e.toLowerCase().includes(q)) ||
t.params?.some(p => p.name.toLowerCase().includes(q)) ||
t.tags?.some(tag => tag.toLowerCase().includes(q))
);
});
return (
<div className="max-w-7xl mx-auto px-6 py-10">
{/* Hero */}
<div className="text-center mb-14">
<div className="inline-flex items-center gap-2 bg-gradient-to-r from-blue-600 to-purple-600 text-white px-4 py-2 rounded-full text-sm font-medium mb-6">
<span>🛠️</span> Available Tools
</div>
<H1 id="available-tools" className="text-4xl md:text-5xl font-extrabold bg-gradient-to-r from-gray-900 via-blue-900 to-purple-900 bg-clip-text text-transparent mb-6">Interactive Tool Explorer</H1>
<PageSubtitle className="text-lg md:text-xl text-gray-600 max-w-3xl mx-auto leading-relaxed">
36 specialized tools. Filter by category, search prompts, copy examples, and get productive in seconds.
</PageSubtitle>
</div>
{/* Quick Actions / Popular */}
<section className="relative mb-16">
<div className="absolute inset-0 bg-gradient-to-r from-blue-50 via-indigo-50 to-purple-50 rounded-2xl" />
<div className="relative bg-white/80 backdrop-blur-sm border border-white/30 rounded-2xl p-6 md:p-8 shadow-xl">
<div className="flex flex-col md:flex-row md:items-center md:justify-between gap-6 mb-6">
<div>
<h2 id="quick-actions" className="text-2xl font-bold text-gray-900 mb-1">🚀 Quick Actions</h2>
<p className="text-sm text-gray-600">Most common starting points – copy and ask your AI now.</p>
</div>
<button onClick={() => setShowPopularExpanded(e=>!e)} className="text-xs font-medium text-blue-700 hover:text-blue-900 bg-blue-50 border border-blue-200 px-3 py-1.5 rounded-lg transition">
{showPopularExpanded ? 'Collapse' : 'Expand'}
</button>
</div>
{showPopularExpanded && (
<div className="grid sm:grid-cols-2 lg:grid-cols-2 gap-4">
{popularTools.map(tool => (
<div key={tool.id} className="relative rounded-xl border border-gray-200 bg-white/90 p-4 shadow-sm group">
<div className="flex items-center justify-between mb-2">
<p className="font-mono text-xs font-semibold text-gray-800">{tool.name}</p>
<button
onClick={() => {
const ex = tool.examples?.[0];
if (ex) navigator.clipboard.writeText(ex);
}}
className="text-[10px] bg-gray-100 hover:bg-gray-200 text-gray-700 px-2 py-0.5 rounded transition"
>Copy</button>
</div>
<p className="text-[11px] text-gray-600 line-clamp-2 group-hover:line-clamp-none transition-all">{tool.description}</p>
{tool.examples && tool.examples.length > 0 && (
<p className="mt-2 text-[11px] text-gray-500 italic">{tool.examples[0]}</p>
)}
<a href={`#${tool.id}`} className="absolute inset-0" aria-label={`Jump to ${tool.name}`}></a>
</div>
))}
</div>
)}
</div>
</section>
{/* Filters */}
<div className="mb-10">
<ToolFilters activeCategory={activeCategory} setActiveCategory={setActiveCategory} search={search} setSearch={setSearch} />
</div>
{/* Legend */}
<div className="flex flex-wrap gap-3 items-center text-[11px] text-gray-600 mb-6">
<span className="flex items-center gap-1"><span className="bg-blue-100 text-blue-700 px-2 py-0.5 rounded-full font-semibold">Full</span> Requires credentials</span>
<span className="flex items-center gap-1"><span className="bg-gradient-to-r from-blue-600 to-purple-600 text-white px-2 py-0.5 rounded-full font-semibold">Docs + Full</span> Both modes</span>
</div>
{/* Results */}
<div className="space-y-14">
{filtered.length === 0 && (
<div className="text-center py-16 border border-dashed border-gray-300 rounded-xl">
<p className="text-sm text-gray-600 mb-4">No tools match that search.</p>
<p className="text-xs text-gray-500">Tip: Try a simpler keyword like <strong>log</strong>, <strong>class</strong>, or <strong>version</strong>.</p>
</div>
)}
{filtered.length > 0 && (
<div className="grid md:grid-cols-2 xl:grid-cols-2 gap-5">
{filtered.map(tool => <ToolCard key={tool.id} tool={tool} />)}
</div>
)}
</div>
{/* Getting Started Hint */}
<div className="mt-20 bg-blue-50 border border-blue-200 rounded-xl p-6">
<h3 className="text-sm font-semibold text-blue-800 mb-2">💡 Mode Recommendation</h3>
<p className="text-xs text-blue-800 leading-relaxed">Explore freely in Documentation Mode first. Add <code className="font-mono bg-blue-100 px-1 py-0.5 rounded">--dw-json</code> later to unlock log analysis, system objects and code version management without changing any other configuration.</p>
</div>
{/* Next Steps */}
<section className="mt-24 mb-12 text-center" aria-labelledby="next-steps">
<h2 id="next-steps" className="text-2xl md:text-3xl font-bold text-gray-900 mb-4">🔗 Next Steps</h2>
<p className="text-sm md:text-base text-gray-600 max-w-2xl mx-auto mb-8">Move from raw tool surface into practical flows or reinforce secure patterns before enabling full-mode capabilities.</p>
<div className="flex flex-col sm:flex-row gap-4 justify-center mb-10">
<a
href="/#/examples"
className="group bg-gradient-to-r from-blue-600 to-purple-600 text-white px-8 py-4 rounded-xl font-semibold text-lg shadow-lg hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1 no-underline hover:no-underline focus:no-underline"
>
Examples & Use Cases
<span className="ml-2 group-hover:translate-x-1 inline-block transition-transform">→</span>
</a>
<a
href="/#/security"
className="border-2 border-gray-300 text-gray-700 px-8 py-4 rounded-xl font-semibold text-lg hover:border-blue-500 hover:text-blue-600 transition-all duration-300 no-underline hover:no-underline focus:no-underline"
>
Security Guidance
</a>
</div>
<div className="grid md:grid-cols-2 gap-6 max-w-4xl mx-auto mb-4 text-left">
<div className="rounded-xl border border-gray-200 bg-white p-5">
<h3 className="font-semibold text-sm mb-2">Why start with examples?</h3>
<p className="text-xs text-gray-600">Shortens prompt iteration by showing multi-step sequences that combine docs lookup, log inspection, and object introspection.</p>
</div>
<div className="rounded-xl border border-blue-200 bg-blue-50 p-5">
<h3 className="font-semibold text-sm mb-2 text-blue-800">Why review security now?</h3>
<p className="text-xs text-blue-700">Prevents leaking credentials, encourages safe log handling, and sets a baseline for principle-of-least-privilege tokens before automation.</p>
</div>
</div>
</section>
</div>
);
};
export default ToolsPage;