Skip to main content
Glama

send_message

Send professional messages in Upwork conversations to reply to client questions, follow up on proposals, clarify project requirements, or communicate during active contracts.

Instructions

Send a message in an Upwork conversation. Use this to:

  • Reply to client questions about your proposal

  • Follow up on submitted proposals (after 3-5 days)

  • Clarify project requirements

  • Communicate during an active contract

Keep messages professional, specific to the project, and value-adding.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
room_idYesThe conversation room ID
messageYesMessage content to send

Implementation Reference

  • Main handler function for 'send_message' tool. Uses Puppeteer (via ensureLoggedIn) to navigate to an Upwork conversation room, find the message input box, type the message with human-like delays, and click send (or press Enter). Returns success/failure result.
    export async function sendMessage(input: SendMessageInput): Promise<SendMessageResult> {
      const page = await ensureLoggedIn();
    
      try {
        const url = `https://www.upwork.com/messages/rooms/${input.room_id}`;
        console.error('[sendMessage] Navigating to:', url);
        await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30000 });
        await humanDelay(2000, 4000);
    
        // Wait for message input
        const inputSelectors = [
          '[data-test="message-input"]',
          '[data-cy="message-input"]',
          'div[contenteditable="true"]',
          'textarea[placeholder*="message"]',
          'textarea[placeholder*="Message"]',
          '.message-input textarea',
          '#message-text',
        ];
    
        let inputEl = null;
        for (const sel of inputSelectors) {
          const el = page.locator(sel).first();
          if (await el.isVisible({ timeout: 5000 }).catch(() => false)) {
            inputEl = el;
            console.error('[sendMessage] Found input with selector:', sel);
            break;
          }
        }
    
        if (!inputEl) {
          return { success: false, message: 'Could not find message input box.' };
        }
    
        await inputEl.click();
        await humanDelay(500, 1000);
    
        // Type message with human-like delays
        await page.keyboard.type(input.message, { delay: Math.random() * 30 + 20 });
        console.error('[sendMessage] Message typed.');
        await humanDelay(1000, 2000);
    
        // Send — try Enter key first, then button
        const sendBtnSelectors = [
          '[data-test="send-message-button"]',
          '[data-cy="send-button"]',
          'button[aria-label="Send message"]',
          'button:has-text("Send")',
        ];
    
        let sent = false;
        for (const sel of sendBtnSelectors) {
          const btn = page.locator(sel).first();
          if (await btn.isVisible({ timeout: 2000 }).catch(() => false)) {
            await btn.click();
            sent = true;
            console.error('[sendMessage] Clicked send button:', sel);
            break;
          }
        }
    
        if (!sent) {
          // Fall back to Ctrl+Enter or Enter
          await page.keyboard.press('Enter');
          sent = true;
          console.error('[sendMessage] Sent via Enter key');
        }
    
        await humanDelay(2000, 3000);
    
        const sentAt = new Date().toISOString();
        return {
          success: true,
          message: 'Message sent successfully.',
          sent_at: sentAt,
        };
      } catch (err) {
        const msg = err instanceof Error ? err.message : String(err);
        console.error('[sendMessage] Error:', msg);
        return { success: false, message: `Failed to send message: ${msg}` };
      } finally {
        await page.close();
      }
    }
  • Zod schema (SendMessageSchema) defining input parameters: room_id (string) and message (string). Also exports TypeScript types SendMessageInput and SendMessageResult.
    export const SendMessageSchema = z.object({
      room_id: z.string().describe('The conversation room ID to send a message to'),
      message: z
        .string()
        .describe(
          'The message content. Be professional and personalized. Mention specific details from the conversation.'
        ),
    });
    
    export type SendMessageInput = z.infer<typeof SendMessageSchema>;
    
    export interface SendMessageResult {
      success: boolean;
      message: string;
      sent_at?: string;
    }
  • src/index.ts:318-322 (registration)
    Tool dispatch: parses args with SendMessageSchema and calls sendMessage() when the tool name is 'send_message'.
    case 'send_message': {
      const input = SendMessageSchema.parse(args);
      result = await sendMessage(input);
      break;
    }
  • src/index.ts:167-185 (registration)
    MCP tool registration metadata: name 'send_message', description, and JSON Schema inputSchema for the tool listing.
      {
        name: 'send_message',
        description: `Send a message in an Upwork conversation.
    Use this to:
    - Reply to client questions about your proposal
    - Follow up on submitted proposals (after 3-5 days)
    - Clarify project requirements
    - Communicate during an active contract
    
    Keep messages professional, specific to the project, and value-adding.`,
        inputSchema: {
          type: 'object',
          properties: {
            room_id: { type: 'string', description: 'The conversation room ID' },
            message: { type: 'string', description: 'Message content to send' },
          },
          required: ['room_id', 'message'],
        },
      },
Behavior2/5

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

No annotations provided, so description must disclose behavioral traits. It mentions professionalism but lacks details on mutation, permissions, rate limits, or response behavior. Significant gap for a write operation.

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?

Description is a concise bullet list, front-loaded with purpose and use cases, no wasted words. Efficient.

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

Completeness4/5

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

Tool is simple and description covers core usage, but lacks return value info (no output schema) and does not differentiate from siblings beyond purpose. Adequate but not fully complete.

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 coverage is 100%, so parameters are documented. Description adds no extra meaning beyond 'room_id' and 'message'; could suggest format constraints but doesn't. Baseline 3 applies.

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

Purpose5/5

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

The description clearly states 'Send a message in an Upwork conversation' and lists specific use cases, distinguishing it from siblings like get_messages (read) and submit_proposal (different action).

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

Usage Guidelines4/5

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

The description provides explicit when-to-use scenarios (reply, follow-up, clarify, communicate) but does not explicitly exclude other uses or compare to alternatives. Still clear and helpful.

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/zcrossoverz/upwork-mcp'

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