AIGPAIGP

Call AI Actions from Your Code – Claude Tool Use Hands-On

P

Prompt

Create a single HTML page demonstrating how to use Claude's Tool Use (function calling) in JavaScript. Include a simple UI where the user can enter a city name and the page simulates calling a weather tool function via the Claude API concept. Use a minimal Swiper or no slider. Use GSAP for a subtle fade-in of results. Include AOS for scroll effects. Show a code snippet of the function definition and the call.

CODE PREVIEW

エディタを読み込み中…

AIとの対話に追加する一言

プロンプトと一緒にコピーして、AIがより正確に意図を汲み取れるようにします

このコードをそのまま使いたいので、CDNリンクも含めた完全なHTMLファイルとして出力してください。

初心者なので、各行にコメントを追加して、何をしているか説明してください。

このコードをWordPressのテーマに組み込む方法も教えてください。

動作確認済みのコードをお願いします。エラーが出る場合の対処法も含めて。

ClaudeのTool Use(関数呼び出し)をJavaScriptアプリに組み込む方法を学びます。このデモでは、ツール(例:getWeather)の定義、API経由での呼び出し、結果表示までの最小フローを示します。都市名を入力すると疑似APIラウンドトリップをシミュレート。コードスニペットでClaudeのツール定義パターンを確認できます。

Prompt Overview

Learn how to integrate Claude's Tool Use (function calling) into your JavaScript app. This demo shows a minimal flow: define a tool (e.g., getWeather), call it via the API, and display the result. The UI lets you type a city and simulates the round-trip. The code snippet highlights the function definition pattern used in Claude's tool use.

Was this prompt helpful?

Comments

Comments appear after moderation

この記事が役に立ったら投げ銭で応援

Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済

開発者が選ぶ最強ツール集

運営者が毎日使っているツール・ガジェット 6選

見る
Homeヘルプ