Skip to main content
Glama
IQAIcom
by IQAIcom

GET_USER_EDITED_WIKIS

Retrieve all wikis edited by a given user on IQ.wiki using their Ethereum address. Optionally filter by time frame.

Instructions

Get wikis edited by a specific user on IQ.wiki

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe Ethereum address of the user
timeFrameSecondsNoOptional time frame in seconds to filter results

Implementation Reference

  • src/index.ts:19-19 (registration)
    Tool registration via server.addTool(getUserEditedWikisTool)
    server.addTool(getUserEditedWikisTool);
  • Handler: tool definition with name GET_USER_EDITED_WIKIS, parameters (zod schema), and execute function that calls GetUserEditedWikisService
    export const getUserEditedWikisTool = {
    	name: "GET_USER_EDITED_WIKIS",
    	description: "Get wikis edited by a specific user on IQ.wiki",
    	parameters: getUserEditedWikisParams,
    	execute: async (params: GetUserEditedWikisParams) => {
    		try {
    			const service = new GetUserEditedWikisService();
    			const wikis = await service.execute(params.id, params.timeFrameSeconds);
    
    			return service.format(wikis);
    		} catch (error) {
    			if (error instanceof Error) {
    				console.log(`Error in GET_USER_EDITED_WIKIS tool: ${error.message}`);
    				return `Error retrieving user edited wikis: ${error.message}`;
    			}
    			return "An unknown error occurred while fetching user edited wikis";
    		}
    	},
    } as const;
  • Input schema: requires id (string, Ethereum address), optional timeFrameSeconds (number)
    const getUserEditedWikisParams = z.object({
    	id: z.string().min(1).describe("The Ethereum address of the user"),
    	timeFrameSeconds: z
    		.number()
    		.optional()
    		.describe("Optional time frame in seconds to filter results"),
    });
  • Service class with execute (GraphQL query, filters by metadata/previous_cid, optional timeframe) and format (formats output with dedent)
    export class GetUserEditedWikisService {
    	async execute(id: string, timeFrameSeconds?: number) {
    		try {
    			const response: any = await client.request(USER_EDITED_WIKIS_QUERY, {
    				id,
    			});
    
    			if (!response.userById) {
    				throw new Error("user does not exist");
    			}
    			if (!response.userById.wikisEdited.activity) {
    				throw new Error("user has not edited any wikis");
    			}
    
    			let wikis = response.userById.wikisEdited.activity[0].content;
    
    			// Since the updated field is null for edited wikis, we need to detect edits by metadata
    			// Filter out wikis that aren't actually edits (they should have previous_cid in metadata)
    			wikis = wikis.filter((wiki: any) => {
    				// Check for edit-specific metadata
    				const hasMetadata = wiki.metadata && Array.isArray(wiki.metadata);
    				if (!hasMetadata) return false;
    
    				// Look for previous_cid which indicates this is an edit
    				return wiki.metadata.some((meta: any) => meta.id === "previous_cid");
    			});
    
    			// Filter by time if timeFrameSeconds is provided
    			// Since we don't have updated timestamps, we'll use timestamp from references if available
    			if (timeFrameSeconds && wikis.length > 0) {
    				const now = new Date();
    				const timeLimit = new Date(now.getTime() - timeFrameSeconds * 1000);
    
    				// We need to skip time filtering because we don't have reliable timestamps
    				// Just inform the user that we can't filter by time
    				if (wikis.length === 0) {
    					// Convert seconds to a human-readable format for the error message
    					const timeFrameText =
    						timeFrameSeconds >= 86400
    							? `${timeFrameSeconds / 86400} day(s)`
    							: timeFrameSeconds >= 3600
    								? `${timeFrameSeconds / 3600} hour(s)`
    								: `${timeFrameSeconds / 60} minute(s)`;
    
    					throw new Error(`No edited wikis found in the last ${timeFrameText}`);
    				}
    			}
    
    			return wikis;
    		} catch (error: any) {
    			throw new Error(error.message);
    		}
    	}
    
    	format(wikis: any) {
    		return wikis
    			.map((wiki: any) => {
    				// Find edit-related metadata
    				const wordsChanged =
    					wiki.metadata.find((m: any) => m.id === "words-changed")?.value ||
    					"Unknown";
    				const percentChanged =
    					wiki.metadata.find((m: any) => m.id === "percent-changed")?.value ||
    					"Unknown";
    				const blocksChanged =
    					wiki.metadata.find((m: any) => m.id === "blocks-changed")?.value ||
    					"Unknown";
    
    				// Get the date from updated or fallback to a reasonable alternative
    				const date = new Date(wiki.updated || wiki.created);
    				const formattedDate = date.toLocaleString();
    
    				return dedent`
    						📜 Wiki Edited
    						- Title: ${wiki.title}
    						- Summary: ${wiki.summary}
    						- Edited: ${formattedDate}
    						- Changes: ${wordsChanged} words (${percentChanged}%)
    						- Modified sections: ${blocksChanged}
    
    						🔗 Source: ${IQ_REVISION_URL}/${wiki.ipfs}
    						🔗 Transaction: https://polygonscan.com/tx/${wiki.transactionHash}
    					`;
    			})
    			.join("\n\n");
    	}
    }
  • GraphQL query (USER_EDITED_WIKIS_QUERY) for fetching user edited wikis
    export const USER_EDITED_WIKIS_QUERY = graphql(`
      query userEditedWikis($id: String!) {
        userById(id: $id) {
          wikisEdited {
            ... on UserActivity {
              activity {
                content {
                  id
                  ipfs
                  transactionHash
                  title
                  created
                  updated
                  summary
                  categories {
                    id
                    title
                  }
                  tags {
                    id
                  }
                  images {
                    id
                    type
                  }
                  metadata {
                    id
                    value
                  }
                  user {
                    id
                    profile {
                      username
                      avatar
                    }
                  }
                }
              }
            }
          }
        }
      }
    `);
Behavior2/5

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

No annotations are present, so the description bears full responsibility for behavioral disclosure. It only states a basic operation without mentioning permissions, rate limits, pagination, ordering, or empty results—missing critical context for a read tool.

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 a single concise sentence with no unnecessary words. However, it lacks structure such as bullet points or sections that could aid readability.

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?

With only 2 parameters and no output schema, the description should explain return values and behavior (e.g., what data is returned, how timeFrameSeconds affects results). It fails to do so, leaving the agent under-informed.

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?

The input schema describes both parameters (id as Ethereum address, timeFrameSeconds as optional filter) with 100% coverage. The description adds no additional meaning beyond the schema, so baseline score 3 is appropriate.

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 action ('Get') and resource ('wikis edited by a specific user on IQ.wiki'), distinguishing from siblings like GET_USER_CREATED_WIKIS. However, it does not explicitly differentiate from other user-related tools.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives (e.g., GET_USER_CREATED_WIKIS or GET_USER_WIKI_ACTIVITIES). The agent must infer usage from tool names alone.

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/IQAIcom/mcp-iqwiki'

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