Skip to main content
Glama
scanady
by scanady
create.ts1.53 kB
/** * Tool: standards_create * Creates a new standard with metadata */ import { CreateStandardInput } from '../schemas/metadata.js'; import { ToolResponse } from '../types.js'; import { createStandard } from '../services/storage.js'; import { refreshIndex } from '../services/indexer.js'; /** * Creates a new standard */ export async function createStandardTool(params: CreateStandardInput, _extra?: unknown): Promise<ToolResponse> { try { const { metadata, content, filename } = params; // Create the standard const standard = await createStandard(metadata, content, filename); // Refresh the index to include the new standard await refreshIndex(); const outputText = `Successfully created standard at: ${standard.path} Metadata: - Type: ${standard.metadata.type} - Tier: ${standard.metadata.tier} - Process: ${standard.metadata.process} - Tags: ${standard.metadata.tags.join(', ')} - Version: ${standard.metadata.version} - Status: ${standard.metadata.status} - Author: ${standard.metadata.author} - Created: ${standard.metadata.created}`; return { content: [ { type: 'text', text: outputText, }, ], structuredContent: { success: true, path: standard.path, metadata: standard.metadata, }, }; } catch (error) { return { content: [ { type: 'text', text: `Error creating standard: ${(error as Error).message}`, }, ], isError: true, }; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/scanady/engineering-standards-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server