Skip to main content
Glama

Send Message to Duyet

send_message

Send messages to Duyet for collaboration, job opportunities, consulting, or general inquiries. Messages are saved with reference IDs for follow-up.

Instructions

Send a message to Duyet for collaboration, job opportunities, consulting, or general inquiries. Messages are saved with a reference ID for follow-up

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesMessage to send to Duyet (10-500 characters)
contact_emailNoOptional: Your email for response
purposeYesPurpose of your message

Implementation Reference

  • The asynchronous handler function for the 'send_message' tool. It performs rate limiting checks, inserts the message into the database using D1, handles errors, and returns structured success or error responses with reference ID.
    		async ({ message, contact_email, purpose }) => {
    			// Check rate limiting before processing
    			const rateLimitCheck = await checkRateLimit(db, contact_email, purpose);
    			if (!rateLimitCheck.allowed) {
    				return {
    					content: [
    						{
    							type: "text",
    							text: `Rate Limit Exceeded
    
    ${rateLimitCheck.reason}
    
    ${rateLimitCheck.retryAfter ? `You can try again in ${Math.ceil(rateLimitCheck.retryAfter / 60)} minutes.` : ""}
    
    Alternative: Email me directly at me@duyet.net`,
    						},
    					],
    					isError: true,
    				};
    			}
    
    			// Extract metadata - simplified for MCP context
    			const ip_address = "unknown";
    			const user_agent = "MCP Client";
    			const referenceId = crypto.randomUUID();
    
    			try {
    				await db.insert(contacts).values({
    					message,
    					contactEmail: contact_email,
    					purpose: purpose,
    					ipAddress: ip_address,
    					userAgent: user_agent,
    					referenceId,
    				});
    			} catch (_e: any) {
    				// Log error securely without exposing details
    				return {
    					content: [
    						{
    							type: "text",
    							text: "Your message was received but could not be saved to our system. Please try again or send your message directly via email at me@duyet.net.",
    						},
    					],
    				};
    			}
    
    			const timestamp = new Date().toLocaleString();
    
    			return {
    				content: [
    					{
    						type: "text",
    						text: `Message Sent Successfully
    
    Reference ID: ${referenceId}
    Message: ${message}
    ${contact_email ? `Your Email: ${contact_email}` : ""}
    Purpose: ${purpose.replace("_", " ")}
    Submitted: ${timestamp}
    
    How to reach Duyet:
    
    Email: me@duyet.net
    LinkedIn: https://linkedin.com/in/duyet
    GitHub: https://github.com/duyet
    
    Your message has been recorded for follow-up.
    
    ${purpose === "job_opportunity" ? "\nFor Job Opportunities: Please include details about the role, company, and tech stack. Remote positions preferred." : ""}
    ${purpose === "consulting" ? "\nFor Consulting: Please provide project scope, timeline, and technical requirements." : ""}`,
    					},
    				],
    			};
    		},
  • Zod schema definitions for input validation: message (10-500 chars string), contact_email (optional email), purpose (enum: collaboration, job_opportunity, consulting, general_inquiry).
    const messageSchema = z.string().min(10).max(500) as any;
    const contactEmailSchema = z.string().email().optional() as any;
    const purposeSchema = z.enum([
    	"collaboration",
    	"job_opportunity",
    	"consulting",
    	"general_inquiry",
    ]) as any;
  • server.registerTool call that registers the 'send_message' MCP tool, specifying title, description, inputSchema, and the handler function.
    	server.registerTool(
    		"send_message",
    		{
    			title: "Send Message to Duyet",
    			description:
    				"Send a message to Duyet for collaboration, job opportunities, consulting, or general inquiries. Messages are saved with a reference ID for follow-up",
    			inputSchema: {
    				message: messageSchema.describe("Message to send to Duyet (10-500 characters)"),
    				contact_email: contactEmailSchema.describe("Optional: Your email for response"),
    				purpose: purposeSchema.describe("Purpose of your message"),
    			},
    		},
    		async ({ message, contact_email, purpose }) => {
    			// Check rate limiting before processing
    			const rateLimitCheck = await checkRateLimit(db, contact_email, purpose);
    			if (!rateLimitCheck.allowed) {
    				return {
    					content: [
    						{
    							type: "text",
    							text: `Rate Limit Exceeded
    
    ${rateLimitCheck.reason}
    
    ${rateLimitCheck.retryAfter ? `You can try again in ${Math.ceil(rateLimitCheck.retryAfter / 60)} minutes.` : ""}
    
    Alternative: Email me directly at me@duyet.net`,
    						},
    					],
    					isError: true,
    				};
    			}
    
    			// Extract metadata - simplified for MCP context
    			const ip_address = "unknown";
    			const user_agent = "MCP Client";
    			const referenceId = crypto.randomUUID();
    
    			try {
    				await db.insert(contacts).values({
    					message,
    					contactEmail: contact_email,
    					purpose: purpose,
    					ipAddress: ip_address,
    					userAgent: user_agent,
    					referenceId,
    				});
    			} catch (_e: any) {
    				// Log error securely without exposing details
    				return {
    					content: [
    						{
    							type: "text",
    							text: "Your message was received but could not be saved to our system. Please try again or send your message directly via email at me@duyet.net.",
    						},
    					],
    				};
    			}
    
    			const timestamp = new Date().toLocaleString();
    
    			return {
    				content: [
    					{
    						type: "text",
    						text: `Message Sent Successfully
    
    Reference ID: ${referenceId}
    Message: ${message}
    ${contact_email ? `Your Email: ${contact_email}` : ""}
    Purpose: ${purpose.replace("_", " ")}
    Submitted: ${timestamp}
    
    How to reach Duyet:
    
    Email: me@duyet.net
    LinkedIn: https://linkedin.com/in/duyet
    GitHub: https://github.com/duyet
    
    Your message has been recorded for follow-up.
    
    ${purpose === "job_opportunity" ? "\nFor Job Opportunities: Please include details about the role, company, and tech stack. Remote positions preferred." : ""}
    ${purpose === "consulting" ? "\nFor Consulting: Please provide project scope, timeline, and technical requirements." : ""}`,
    					},
    				],
    			};
    		},
    	);
  • Call to registerSendMessageTool(server, env) as part of registering all interaction tools, followed by logging.
    registerSendMessageTool(server, env);
    logger.tool("send_message", "registered");
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that 'Messages are saved with a reference ID for follow-up', which adds useful context about persistence and tracking. However, it fails to disclose critical behavioral traits such as whether this is a read-only or mutative operation, authentication requirements, rate limits, or error handling. For a tool that likely involves sending data, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with two sentences that efficiently convey the tool's purpose and key behavioral detail (reference ID). Every sentence earns its place without redundancy or fluff, making it easy to scan and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a message-sending tool with no annotations and no output schema), the description is incomplete. It lacks details on behavioral aspects (e.g., mutative nature, auth needs), output format (what the reference ID looks like or response structure), and error scenarios. While it covers the basic purpose, it doesn't provide enough context for safe and effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description does not add any parameter-specific semantics beyond what the schema provides (e.g., it doesn't explain the 'purpose' enum values or 'message' constraints further). Baseline 3 is appropriate when the schema does the heavy lifting, but no extra value is added.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Send') and resource ('message to Duyet'), specifying the action and target. It distinguishes from siblings like 'say_hi' by mentioning specific use cases (collaboration, job opportunities, etc.), though it doesn't explicitly contrast with all siblings. The purpose is well-defined but could be more distinct from similar tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage contexts (collaboration, job opportunities, consulting, general inquiries), providing some guidance on when to use this tool. However, it lacks explicit when-not-to-use scenarios or alternatives (e.g., vs. 'say_hi' or 'hire_me'), leaving room for ambiguity. The guidance is helpful but not comprehensive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/duyet/duyet-mcp-server'

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