Skip to main content
Glama
nayakprashant

Selenium MCP Server

type_into_element

Type text into an input field or textarea using the element index from get_interactive_elements. Clears existing text before entering new text.

Instructions

Enter text into an input field or textarea using an element index.

Purpose

This tool allows the agent to type text into editable elements such as input fields or textareas. The element must first be discovered using get_interactive_elements, which returns a list of visible UI elements along with their corresponding indexes.

The index returned by get_interactive_elements should be used directly with this tool to identify which element to type into.

  1. Call get_interactive_elements to retrieve all interactive elements.

  2. Identify the correct element by reviewing fields such as:

    • text

    • placeholder

    • aria_label

    • tag

  3. Use the provided index to call type_into_element.

  4. If the page changes after typing (e.g., search suggestions appear), consider calling get_interactive_elements again.

Parameters

session_id : str Active browser session identifier returned by open_browser.

index : int Index of the element to type into. This must correspond to the index returned by get_interactive_elements.

text : str The text to be entered into the selected element.

Returns

dict { "session_id": str, "index": index of the element used, "text_to_type": the text to enter, "status": str, "message": str }

Error Conditions

If get_interactive_elements has not been called previously, the element cache may be empty and the tool will return an error.

Notes

This tool automatically clears any existing text in the element before entering the new text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
indexYes
session_idYes
Behavior4/5

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

No annotations are provided, so the description carries full burden. It discloses that the tool clears existing text before entering new text (notes section) and mentions error conditions when cache is empty. However, it does not specify whether input/change events are triggered or if the tool waits for elements to be interactive.

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

Conciseness4/5

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

The description is well-structured with clear sections (Purpose, Recommended Agent Workflow, Parameters, Returns, Error Conditions, Notes). It is front-loaded with the most important information. While slightly verbose, every sentence adds value. A minor improvement would be to condense the workflow slightly.

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?

Given no annotations and no output schema, the description covers prerequisites, workflow, return format (including dict structure), error conditions, and a behavioral note about clearing text. It lacks details on exact typing mechanism (e.g., keystroke simulation) and behavior with disabled elements, but overall it is sufficiently complete for a typing operation.

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

Parameters5/5

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

The input schema has 0% description coverage, so the description fully compensates by explaining each parameter: index must come from get_interactive_elements, text is the string to type, session_id from open_browser. It also describes the return format (dict with relevant fields), adding significant value beyond the schema.

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 the tool's purpose: 'Enter text into an input field or textarea using an element index.' It specifies the verb (type/enter), resource (input field/textarea), and distinguishes from sibling tool click_element by focusing on text entry. The prerequisite use of get_interactive_elements is also highlighted.

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

Usage Guidelines5/5

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

The description provides a detailed recommended workflow (steps 1-4), explicitly stating when to use the tool (after get_interactive_elements) and when to re-evaluate (if page changes after typing). It also includes an error condition (empty element cache) and implicitly sets expectations for not using it before discovering elements.

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

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