Skip to main content
Glama
wlmwwx

Jina AI Remote MCP Server

by wlmwwx

primer

Retrieve current session context including time, location, and network environment to deliver personalized, relevant responses based on real-time conditions.

Instructions

Get up-to-date contextual information of the current session to provide localized, time-aware responses. Use this when you need to know the current time, user's location, or network environment to give more relevant and personalized information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'primer' tool: retrieves session context from props and returns it as YAML-formatted text, with error handling.
    async () => {
    	try {
    		const props = getProps();
    		const context = props.context;
    
    		if (!context) {
    			throw new Error("No context information available");
    		}
    
    		return {
    			content: [{ type: "text" as const, text: yamlStringify(context) }],
    		};
    	} catch (error) {
    		return createErrorResponse(`Error: ${error instanceof Error ? error.message : String(error)}`);
    	}
    },
  • Registration of the 'primer' tool using server.tool(), including name, description, empty schema, and inline handler.
    // Primer tool - provides current world knowledge for LLMs
    server.tool(
    	"primer",
    	"Get up-to-date contextual information of the current session to provide localized, time-aware responses. Use this when you need to know the current time, user's location, or network environment to give more relevant and personalized information.",
    	{},
    	async () => {
    		try {
    			const props = getProps();
    			const context = props.context;
    
    			if (!context) {
    				throw new Error("No context information available");
    			}
    
    			return {
    				content: [{ type: "text" as const, text: yamlStringify(context) }],
    			};
    		} catch (error) {
    			return createErrorResponse(`Error: ${error instanceof Error ? error.message : String(error)}`);
    		}
    	},
    );
  • Helper code that builds the context object (timestamp, client, location, network info from CF and headers) and attaches it to props for use by the primer tool.
    // Extract context information for the primer tool
    const context: any = {};
    
    // Add timestamp info
    context.timestamp = {
    	utc: new Date().toISOString(),
    };
    if (cf?.timezone) {
    	context.timestamp.userTimezone = cf.timezone;
    	context.timestamp.userLocalTime = new Date().toLocaleString('en-US', { timeZone: cf.timezone as string });
    }
    
    // Add client info (only if values exist)
    const client: any = {};
    const clientIp = request.headers.get('CF-Connecting-IP');
    const userAgent = request.headers.get('User-Agent');
    const acceptLanguage = request.headers.get('Accept-Language');
    
    if (clientIp) client.ip = clientIp;
    if (userAgent) client.userAgent = userAgent;
    if (acceptLanguage) client.acceptLanguage = acceptLanguage;
    if (Object.keys(client).length > 0) context.client = client;
    
    // Add location info (only if values exist)
    const location: any = {};
    if (cf?.country) location.country = cf.country;
    if (cf?.city) location.city = cf.city;
    if (cf?.region) location.region = cf.region;
    if (cf?.regionCode) location.regionCode = cf.regionCode;
    if (cf?.continent) location.continent = cf.continent;
    if (cf?.postalCode) location.postalCode = cf.postalCode;
    if (cf?.metroCode) location.metroCode = cf.metroCode;
    if (cf?.timezone) location.timezone = cf.timezone;
    if (cf?.latitude && cf?.longitude) {
    	location.coordinates = {
    		lat: cf.latitude,
    		lon: cf.longitude
    	};
    }
    if (cf?.isEUCountry === "1") location.isEU = true;
    if (Object.keys(location).length > 0) context.location = location;
    
    // Add network info (only if values exist)
    const network: any = {};
    if (cf?.asn) network.asn = cf.asn;
    if (cf?.asOrganization) network.organization = cf.asOrganization;
    if (cf?.colo) network.datacenter = cf.colo;
    if (cf?.httpProtocol) network.protocol = cf.httpProtocol;
    if (cf?.tlsVersion) network.tlsVersion = cf.tlsVersion;
    if (Object.keys(network).length > 0) context.network = network;
    
    // Add context to props
    ctx.props = { ...ctx.props, context };
Behavior3/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. It describes what information the tool provides (time, location, network environment) and the purpose (enabling localized, time-aware responses). However, it doesn't disclose important behavioral aspects like whether this requires user permissions, what format the information returns, whether it's cached or real-time, or any rate limits. The description adds value but leaves significant behavioral questions unanswered.

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 perfectly concise and well-structured. Two sentences: the first states the purpose with specific examples, the second provides clear usage guidance. Every word earns its place with no redundancy or fluff. The information is front-loaded with the core purpose immediately stated.

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

Completeness3/5

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

Given the tool's complexity (session context retrieval), lack of annotations, and no output schema, the description is moderately complete. It explains what the tool provides and when to use it, but doesn't describe the return format, data structure, or any limitations. For a context-fetching tool with no structured output documentation, the description should ideally specify what exactly gets returned (e.g., 'returns an object with time, location, and network properties').

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage. The description doesn't need to explain parameters since none exist. It appropriately focuses on what the tool does rather than parameter details. The baseline for 0 parameters is 4, and the description meets this expectation without attempting to document non-existent parameters.

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 tool's purpose: 'Get up-to-date contextual information of the current session to provide localized, time-aware responses.' It specifies the verb ('Get') and resource ('contextual information') with concrete examples (time, location, network environment). However, it doesn't explicitly differentiate from sibling tools, which are mostly search/processing tools unrelated to session context.

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 clear usage context: 'Use this when you need to know the current time, user's location, or network environment to give more relevant and personalized information.' It gives specific scenarios for when to use the tool. However, it doesn't mention when NOT to use it or explicitly contrast with alternatives among the sibling tools.

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/wlmwwx/jina-mcp'

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