Prompt Content
Create a Mastra AI tool named 'verify_ai_proficiency' that simulates an external service verifying a skill. This tool should accept `skill_name` and `proficiency_level` and return a mock `verification_status` ('Verified'/'Unverified') and `verification_score` (0-1). Demonstrate how your Mastra AI agent would call this tool to verify a generated SkillProof document and update its status.
```typescript
import { createTool } from '@mastra-ai/core';
const verifyAIProficiencyTool = createTool({
name: 'verifyAIProficiency',
description: 'Simulates external verification of AI proficiency.',
input: { type: 'object', properties: { skillName: { type: 'string' }, proficiencyLevel: { type: 'string' } } },
output: { type: 'object', properties: { verificationStatus: { type: 'string' }, verificationScore: { type: 'number' } } },
async handler({ skillName, proficiencyLevel }) {
// Mock logic for verification
const score = proficiencyLevel === 'Expert' ? 0.9 + Math.random() * 0.1 : 0.5 + Math.random() * 0.2;
const status = score > 0.7 ? 'Verified' : 'Unverified';
return { verificationStatus: status, verificationScore: parseFloat(score.toFixed(2)), verifiedBy: 'MockAIProficiencyService' };
},
});
// Mastra AI agent would have a flow like this:
// agent.onIntent('verify_document', async ({ state }) => {
// const doc = state.get('skillProofDocument');
// if (doc) {
// const verificationResult = await agent.runTool(verifyAIProficiencyTool, { skillName: doc.skillName, proficiencyLevel: doc.proficiencyLevel });
// state.set('skillProofDocument', { ...doc, verification: verificationResult });
// return `Verification complete: ${verificationResult.verificationStatus}`;
// }
// return 'No document to verify.';
// });
```Try this prompt
Open the workspace to execute this prompt with free credits, or use your own API keys for unlimited usage.
Related Prompts
Explore similar prompts from our community
Usage Tips
Copy the prompt and paste it into your preferred AI tool (Claude, ChatGPT, Gemini)
Customize placeholder values with your specific requirements and context
For best results, provide clear examples and test different variations